Jump to content

 

Photo

How synchronize XAxis of the different,separated charts


  • Please log in to reply
5 replies to this topic

#1 EvgenyV

EvgenyV

    Advanced Member

  • Members
  • PipPipPip
  • 41 posts

Posted 28 February 2012 - 09:34 AM

Hi Guys ,

Using visifire charts, I'm displaying 6 separate charts vertically (all with the same properties & settings). I need all the charts to look as if it is one big chart, with one X Axis for all charts.
Therefore only the bottom chart displays the X axis (AxisX[0].Enabled = true)
The problem is that once I display the X axis for the bottom chart, it becomes smaller than all other charts, and the X axis of all charts is not synchronized any more.
Also, I'm displaying a red line at a specific point on all charts () and it is displayed in an offset for all charts which do not show the X axis, I assume it is caused by the same problem, but the offset is smaller then the difference in size between charts.
Note , that this bugs fixed if i set zooming enabled = true, how do it for all states? (Attached is a screen shot).

I using by 4.5.2.0(SLVisifire.Charts.dll) - enterprise version visifire charts,
(Attached is a screen shot) ,sorry for my question , what is a purpose of SL.Visifire.Charts.xap & Visifire.js ?

Here the code of assigning XValue for DataPoints for all charts (in Loop):

chart.Series.Clear();

int numPoints = waveform.NumCycles * waveform.PointsPerCycle;
DataSeries ds = new DataSeries() { RenderAs = RenderAs.QuickLine, MarkerEnabled = false };
chart.Series.Add(ds);
chart.AxesX[0].Interval = numPoints / 10; //waveform.PointsPerCycle * 2;
chart.AxesY[0].AxisLabels = new AxisLabels();
chart.AxesY[0].AxisLabels.MinWidth = 40;
for (int i = 0; i < numPoints; i++)
{
DataPoint dp = new DataPoint();

DateTime xDate = waveform.RecordedTime.AddMilliseconds(i * waveform.SampleRate);
dp.AxisXLabel = xDate.ToString("HH:mm:ss.fff");
dp.YValue = Channel.ValuesArray[i];
ds.DataPoints.Add(dp);
}

Can you please send me a solution for how to synchronize the X axis of all charts,
that it very important project for energy consumption.

Regards ,
Evgeny

Attached Files



#2 sharmila

sharmila

    Advanced Member

  • Administrators
  • PipPipPip
  • 697 posts
  • Gender:Female

Posted 29 February 2012 - 05:09 AM

Hi Evgeniy,

In this case I suggest you to set suitable MinWidth property of AxisLabels element in all y-axis present in all charts. (For Example: Try bigger values for MinWidth). Also you can set Angle property of AxisLabels in x-axis to 90.

Regards,
Sharmila

#3 Eva

Eva

    Advanced Member

  • Members
  • PipPipPip
  • 365 posts
  • Gender:Female

Posted 29 February 2012 - 06:06 AM

I think AxisMininum and AxisMaximum are not same on x-axis for all chart. Enable x-axes for all charts and see the difference. Have you noticed that the last chart contains less Data than other charts? That means data (x-values or number of DataPoints) are not same for all charts. So AxisMaximum and AxisMinumum may differ from chart to chart. So I suggest you to set proper AxisMaximum and AxisMinimum for all charts.
Regards,
Eva

#4 EvgenyV

EvgenyV

    Advanced Member

  • Members
  • PipPipPip
  • 41 posts

Posted 26 March 2012 - 12:18 PM

I think AxisMininum and AxisMaximum are not same on x-axis for all chart. Enable x-axes for all charts and see the difference. Have you noticed that the last chart contains less Data than other charts? That means data (x-values or number of DataPoints) are not same for all charts. So AxisMaximum and AxisMinumum may differ from chart to chart. So I suggest you to set proper AxisMaximum and AxisMinimum for all charts.


Hi Eva ,
attached images , where Y values of three upper's charts changed on the fly (Yvalue *0.25) & in result we have delta in Red line & in AxisY,
how can i synchronize all separated charts by AxisY & Red line in this situation ( fix the delta between them).

Thank you ,
Evgeniy.

Attached Files



#5 vivek

vivek

    Advanced Member

  • Team Visifire
  • PipPipPip
  • 3,597 posts
  • Gender:Male
  • Location:Bangalore

Posted 27 March 2012 - 05:17 AM

In order to align Axis for all charts, try setting proper Padding on AxisY for all charts. You can refer the example from Visifire gallery below.
http://www.visifire....=600&height=375

In this example, we have set Padding on AxisY for first chart so that it will be aligned properly with another chart.

Regards,
Vivek
Team Visifire


#6 EvgenyV

EvgenyV

    Advanced Member

  • Members
  • PipPipPip
  • 41 posts

Posted 29 March 2012 - 10:52 AM

In order to align Axis for all charts, try setting proper Padding on AxisY for all charts. You can refer the example from Visifire gallery below.
http://www.visifire.com/popup.php?url=CandleStick2D4.xml?version=17&width=600&height=375

In this example, we have set Padding on AxisY for first chart so that it will be aligned properly with another chart.


Hi Vivek ,
thank you for your feedback.
We have solving this bug by using : chart.AxesY[0].AxisLabels.MinWidth = 40; , for all separeted charts.

Thanx




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users