Problems with a square scatter chart
Posted: Wed Sep 25, 2019 3:01 pm
Our software requires a scatter chart with a perfectly square charting area, with the same values in each axis, and a circular shaded region.
To do this I'm using a FreeformPoint series, forcing the chart's width to equal the chart's height, and setting the ViewXY's ManualAspectRatioWH to 1. To create the shaded region I'm using a SeriesPoint at 0,0 and setting the PointShapeStyle to a circle of the desired size and thickness. To get the correct size for this circle I'm using a coefficient value (charting area height divided by axis range). This gives me almost perfect results, but there are problems.
You can see in the screenshot that the shaded area appears to be off centre, with more white space showing on the x axis before -150 than after 150. There is a similar problem in the y axis.
After literally pixel counting I found that the gridlines are uneven. Two "rows" are an extra pixel in height, and one column is an extra pixel in width (I've marked the problematic rows and columns with red lines in the picture). The chart is also two pixels wider than it is taller. This is causes the shaded area to be the incorrect size and thickness.
Accuracy is crucial for our software, so I have to ensure that all chart elements are drawn in the correct places to the correct size.
Is it possible to create a perfectly square charting area without these inconsistencies?
Also do you know of a better way to achieve the circular shaded area in Lightning Chart? The size and thickness of the area must be tied to the axes, so they will resize on zooming. The current coefficient method was the only possible way in a previous charting package so it's been carried over for now. I understand this is a rather non-standard chart, but I appreciate your help.
We are currently using v.8.3.1_20180404
Thanks in advance, and let me know if you need any additional information.
Ewan.
To do this I'm using a FreeformPoint series, forcing the chart's width to equal the chart's height, and setting the ViewXY's ManualAspectRatioWH to 1. To create the shaded region I'm using a SeriesPoint at 0,0 and setting the PointShapeStyle to a circle of the desired size and thickness. To get the correct size for this circle I'm using a coefficient value (charting area height divided by axis range). This gives me almost perfect results, but there are problems.
You can see in the screenshot that the shaded area appears to be off centre, with more white space showing on the x axis before -150 than after 150. There is a similar problem in the y axis.
After literally pixel counting I found that the gridlines are uneven. Two "rows" are an extra pixel in height, and one column is an extra pixel in width (I've marked the problematic rows and columns with red lines in the picture). The chart is also two pixels wider than it is taller. This is causes the shaded area to be the incorrect size and thickness.
Accuracy is crucial for our software, so I have to ensure that all chart elements are drawn in the correct places to the correct size.
Is it possible to create a perfectly square charting area without these inconsistencies?
Also do you know of a better way to achieve the circular shaded area in Lightning Chart? The size and thickness of the area must be tied to the axes, so they will resize on zooming. The current coefficient method was the only possible way in a previous charting package so it's been carried over for now. I understand this is a rather non-standard chart, but I appreciate your help.
We are currently using v.8.3.1_20180404
Thanks in advance, and let me know if you need any additional information.
Ewan.