Microsoft Developer Network > Forenhomepage > Chart Controls for .NET Framework > Synchronization Of different Vertically alligned X-axes
Stellen Sie eine FrageStellen Sie eine Frage
 

Vorgeschlagene AntwortSynchronization Of different Vertically alligned X-axes

  • Freitag, 26. Juni 2009 05:13srazreddy TeilnehmermedaillenTeilnehmermedaillenTeilnehmermedaillenTeilnehmermedaillenTeilnehmermedaillen
     
    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

    • Bearbeitetsrazreddy Freitag, 26. Juni 2009 06:32
    •  

Alle Antworten

  • Freitag, 26. Juni 2009 16:56Nader Nashed MSFTMSFTTeilnehmermedaillenTeilnehmermedaillenTeilnehmermedaillenTeilnehmermedaillenTeilnehmermedaillen
     Vorgeschlagene Antwort

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

  • Freitag, 3. Juli 2009 05:39srazreddy TeilnehmermedaillenTeilnehmermedaillenTeilnehmermedaillenTeilnehmermedaillenTeilnehmermedaillen
     
    yes,
    I set the same for two chartAreas, still its not syncronising
  • Samstag, 11. Juli 2009 19:19Alex GorevMSFT, BesitzerTeilnehmermedaillenTeilnehmermedaillenTeilnehmermedaillenTeilnehmermedaillenTeilnehmermedaillen
     
    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
  • Donnerstag, 23. Juli 2009 09:53srazreddy TeilnehmermedaillenTeilnehmermedaillenTeilnehmermedaillenTeilnehmermedaillenTeilnehmermedaillen
     Enthält 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