The space problem between the chart title and the axis title in LightningChart, a high-performance chart control

LightningChart is fully GPU accelerated and optimized for performance, which can be used to display massive amounts of data in real time-over 1 billion data points. LightningChart includes a wide range of 2D, advanced 3D, Polar, Smith, 3D pie/donuts, geographic maps and GIS charts, as well as volume rendering functions suitable for science, engineering, medicine, aviation, trade, energy and other fields.

Space between chart title and axis title

Newbie to LightningChart. When I set the chart title to the left and rotate it 90 degrees, it is either drawn on the y-axis title (chart.ViewXY.AxisLayout.AutoAdjustMargins = true;) or on the left side of the y-axis title (chart.ViewXY. AxisLayout.AutoAdjustMargins = false;), but the distance between the axis title and the chart title is 0. How can I ensure that there is some space between the Chart and the Axis title at runtime (ie, I don't know the layout at compile time)?

Re: Space between chart title and axis title

It seems that the automatic alignment of Chart's Title and YAxis does not work properly (for example, the automatic alignment with XAxis). This must be an error and we will try to fix it as soon as possible.

If you need "LeftCenter" or "RightCenter" to align with the "Chart Title", you may need to use manual margins. Since ViewXY.Margin.Left = 80 (by default), the difference with AutoAdjustMargins disabled (by default) is only slightly larger than auto-margin. By adding ViewXY.Margin.Left, you will avoid overlapping Chart and Axis titles. Other options are to place the "chart title" elsewhere or use the "offset" property.
For the time being, AutoAdjustMargins = true does not apply to left or right headings, but I am trying to use manual margins based on the position and font size of the heading. I suspect this is not a long-term solution, so I look forward to a fix. Unfortunately, I need to allow the end user to place the title and axis on either side, so for now I will continue to use manual margins.

After rendering the Chart (for example, raising the AfterRendering event), you can use the following methods to help estimate the margins:
* Read the Active Axis area (including the Axis line itself and the label (the title is outside the area))

var area = Axes.GetActiveAxisArea();

* Read the position of the axis title

var rect = Axes.Title.DrawRectangle;

*Measure the size of the rendered text

_chart.MeasureText(Text, Font); // [please note that Chart.MeasureText(Text, Font) output in DIP units; use DpiHelper.DipToPx() where needed]

In the case of AutoAdjustMargins = true (which is what we really want), in most cases, the extra space between the margins and the text (called schmutz) can be displayed. In some cases, schmutz is 0, and there is no space between the outermost text and the border. For example, using DemoAppWinForms | Basic Knowledge Point and Line Example:

使用
_chart.Title.Align = ChartTitleAlignment.RightCenter; 
_chart.Title.Angle = 90; 

schmutz很好,标题看起来不错。但是使用
_chart.Title.Angle = -90; 

schmutz为0,标题看起来不太好(靠边框)。

我们完全不使用-90是可以的,所以没有问题。只是以为您想知道。另外,您还设置了示例应用程序,并且拥有我们可以使用的源代码,非常出色!出色的。

Guess you like

Origin blog.51cto.com/15078157/2678079