Page 1 of 1

Axis Titles are rendered late when using Segmented axes

Posted: Thu Feb 28, 2019 2:29 pm
by mobusek
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();
	}
}

Re: Axis Titles are rendered late when using Segmented axes

Posted: Fri Mar 01, 2019 10:27 am
by ArctionKestutis
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();
   }

Re: Axis Titles are rendered late when using Segmented axes

Posted: Wed Jun 05, 2019 12:21 pm
by ArctionKestutis
The issue was fixed in latest (v8.4.2.4001) LightningChart release.
All the best.