.NET Framework Developer Center > .NET Development Forums > Chart Controls for .NET Framework > Synchronization Of different Vertically alligned X-axes
Ask a questionAsk a question
 

Proposed AnswerSynchronization Of different Vertically alligned X-axes

  • Friday, June 26, 2009 5:13 AMsrazreddy Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    hello,

    In my application I created multiple ChartAreas with corresponding different Series.

    These all ChartAreas alligned vertically& style is like this

    m_chart.ChartAreas[2 * (nSeriesCount)].AlignmentOrientation =

    AreaAlignmentOrientations.Vertical;

    m_chart.ChartAreas[2 * (nSeriesCount)].AlignmentStyle =

     

    AreaAlignmentStyles.AxesView|AreaAlignmentStyles.PlotPosition;


    and I gave the X-axis Maximum& Minimum to all x-axes is same.

    Here  while Zooming Operation the Two vertically alligned axes are  showing x-axes Labels at different places .
    how can I show together X-axes labels,but some times synchronizing perfectly with same settings  ,some times not
    is it beacause of SelectionRange Of ChartArea or LabelInterval/labelIntervelType..?

    I tried above cases ,still I did get the solution

    Regards,
    Sraz

    • Edited bysrazreddy Friday, June 26, 2009 6:32 AM
    •  

All Replies

  • Friday, June 26, 2009 4:56 PMNader Nashed MSFTMSFTUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Proposed Answer

    Try to set the Axis.Interval to the same value on both chart areas

  • Friday, July 03, 2009 5:39 AMsrazreddy Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    yes,
    I set the same for two chartAreas, still its not syncronising
  • Saturday, July 11, 2009 7:19 PMAlex GorevMSFT, OwnerUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Can you serialize your chart into XML file using Chart.serializer.Save and post it in the thread? Try to remove all unrelated settings.

    Alex.
    http://blogs.msdn.com/alexgor
  • Thursday, July 23, 2009 9:53 AMsrazreddy Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Has Code
    Hi ,alex

    Here Iam uploading my XML file.
    In my appllication There are two(or more) ChartAreas,and these X-axes labels are syncronizing perfectly when it in complete Zoomout position(Zoom Reset state).
    But when Iam doing Zoom operation ,the scrollBar Enabling is file ,displaying X-lables are fine Not syncronising .
    Please give what i need to set more.

    - <Chart Size="683, 626">
    - <Series>
    - <Series Name="Series1" Legend="Legend1" XValueType="Time" YValueType="Double" ChartArea="ChartArea2">
    - <Points>
      <DataPoint XValue="40016.71037922454" YValues="38" /> 
      <DataPoint XValue="40016.710384467595" YValues="38" /> 
      <DataPoint XValue="40016.710396041664" YValues="114" /> 
      <DataPoint XValue="40016.710407615741" YValues="2" /> 
      <DataPoint XValue="40016.710587557871" YValues="176" /> 
      <DataPoint XValue="40016.710602928244" YValues="117" /> 
      <DataPoint XValue="40016.710610706017" YValues="117" /> 
      <DataPoint XValue="40016.710622280094" YValues="153" /> 
      </Points>
      </Series>
    - <Series Name="Series3" Legend="Legend1" XValueType="Time" YValueType="Double" ChartArea="ChartArea3">
    - <Points>
      <DataPoint XValue="40016.710587557871" YValues="0" /> 
      <DataPoint XValue="40016.710602928244" YValues="24393" /> 
      <DataPoint XValue="40016.710610706017" YValues="24393" /> 
      <DataPoint XValue="40016.710622280094" YValues="24084" /> 
      </Points>
      </Series>
      </Series>
    - <Legends>
      <Legend Name="Legend1" /> 
      </Legends>
    - <ChartAreas>
    - <ChartArea AlignWithChartArea="ChartArea3" AlignmentStyle="PlotPosition, AxesView" BackColor="Transparent" Name="ChartArea2">
      <CursorX IsUserEnabled="True" IsUserSelectionEnabled="True" Interval="0" IntervalType="Seconds" /> 
    - <AxisY>
      <LabelStyle ForeColor="Red" /> 
      </AxisY>
    - <AxisX IntervalType="Seconds" Maximum="40016.71064542824" Minimum="40016.709927835647">
      <LabelStyle Format="HH:mm:ss tt" /> 
      <ScaleView Position="40016.710275748388" Size="0.00013316759577719495" SizeType="Number" MinSize="0" MinSizeType="Seconds" SmallScrollMinSize="0" SmallScrollMinSizeType="Seconds" /> 
      <ScrollBar ButtonColor="LightBlue" BackColor="AliceBlue" /> 
      </AxisX>
      <Position X="5" Y="5" Width="80" Height="80" Auto="False" /> 
      <InnerPlotPosition X="5" Y="5" Width="80" Height="80" Auto="False" /> 
      </ChartArea>
    - <ChartArea AlignWithChartArea="ChartArea2" AlignmentStyle="PlotPosition, AxesView" BackColor="Transparent" Name="ChartArea3">
      <CursorX Position="40016.710408915984" IsUserEnabled="True" IsUserSelectionEnabled="True" Interval="0" IntervalType="Seconds" /> 
    - <AxisY>
      <LabelStyle ForeColor="LawnGreen" /> 
      </AxisY>
    - <AxisX IntervalType="Seconds" Maximum="40016.71064542824" Minimum="40016.709927835647">
      <LabelStyle Format="HH:mm:ss tt" /> 
      <ScaleView Position="40016.710275748388" Size="0.00013316759577719495" SizeType="Number" MinSize="0" MinSizeType="Seconds" SmallScrollMinSize="0" SmallScrollMinSizeType="Seconds" /> 
      <ScrollBar ButtonColor="LightBlue" BackColor="AliceBlue" /> 
      </AxisX>
      <Position X="5" Y="5" Width="80" Height="80" Auto="False" /> 
      <InnerPlotPosition X="5" Y="5" Width="80" Height="80" Auto="False" /> 
      </ChartArea>
      </ChartAreas>
      </Chart>
    
    Thanks& Regards
    sraz