Axis Titles are rendered late when using Segmented axes

A forum dedicated to WPF version of LightningChart Ultimate.

Moderator: Arction_LasseP

mobusek
Posts: 8
Joined: Tue Mar 27, 2018 2:16 pm

Axis Titles are rendered late when using Segmented axes

Post by mobusek » Thu Feb 28, 2019 2:29 pm

I've been experimenting with using YAxesLayout.Segmented to handle certain of our use cases. With this axis layout, it seems that the Y axis title is rendered after the line series are plotted. This means for a few moments the chart shows the new data, then it applies the Y axis titles, causing things to resize. This is a pretty jarring experience. Is there something wrong with how I'm setting up my axis segments? Below is the code I used to create the attached screenshot

Code: Select all

private void Button_Click(object sender, RoutedEventArgs e)
{
	try
	{
		this.chart.BeginUpdate();
		this.chart.ViewXY.YAxes.Clear();
		this.chart.ViewXY.PointLineSeries.Clear();

		this.chart.ViewXY.AxisLayout.YAxesLayout = YAxesLayout.Segmented;
		this.chart.ViewXY.AxisLayout.YAxisAutoPlacement = YAxisAutoPlacement.AllLeft;
		this.chart.ViewXY.AxisLayout.Segments.Clear();
		this.chart.ViewXY.AxisLayout.Segments.Add(new YAxisSegment(this.chart));
		this.chart.ViewXY.AxisLayout.Segments.Add(new YAxisSegment(this.chart));

		for (int i = 0; i < 2; i++)
		{
			AxisY axis = new AxisY(this.chart.ViewXY);
			axis.SegmentIndex = i;

			PointLineSeries pointLineSeries = new PointLineSeries(this.chart.ViewXY, this.chart.ViewXY.XAxes.First(), axis);
			IEnumerable<double> data = Enumerable.Range(0, 1000).Select((num) => (double)num);
			pointLineSeries.SetValues(data.ToArray(), data.ToArray());

			this.chart.ViewXY.YAxes.Add(axis);
			this.chart.ViewXY.PointLineSeries.Add(pointLineSeries);
		}
	}
	finally
	{
		this.chart.EndUpdate();
	}
}
Attachments
Before and After images of the rendering problem
Before and After images of the rendering problem
AxisTitleProblem.png (77.65 KiB) Viewed 2490 times

ArctionKestutis
Posts: 383
Joined: Mon Mar 14, 2016 9:22 am

Re: Axis Titles are rendered late when using Segmented axes

Post by ArctionKestutis » Fri Mar 01, 2019 10:27 am

Thank you for the report.
You did everything correctly, there is some error in LightningChart, which prevent YAxes update together with all Chart rendering. We will fix it as soon as possible.
The workaround is to initiate another chart rendering after EndUpdate() call:

Code: Select all

   finally
   {
      this.chart.EndUpdate();
      // workaround
      this.chart.FullRepaint();
   }

ArctionKestutis
Posts: 383
Joined: Mon Mar 14, 2016 9:22 am

Re: Axis Titles are rendered late when using Segmented axes

Post by ArctionKestutis » Wed Jun 05, 2019 12:21 pm

The issue was fixed in latest (v8.4.2.4001) LightningChart release.
All the best.