Jump to content
Software FX Community

Horizontal Zero Line with Multiple Panes


Recommended Posts

When I use the multiple pane feature, it seems that my charts lose the grey horizontal zero line. This happens even if I have one pane in the chart. The zero line shows up fine if I have a single chart but I don't use panes. I'm using Chart FX 6.2 COM with Visual C++ and MFC.

How do I get the zero line to show up?

 Thanks.

Link to post
Share on other sites
  • 1 year later...

This code genereates 2 panes. In the second pane the zero line is missing. This alway occurs when there are positive and negative numbers in the series. A work around may be to define a Constant Line for value 0 with the same color + width as the zero line would have, but I would prefer a more elegant solution.

 

  'Fill data with positive and negative numbers

  Chart1.ClearData ClearDataFlag_AllData

  Chart1.OpenData COD_Values, 2, 2

 

  Chart1.Value(0, 0) = 50

  Chart1.Value(0, 1) = -75

  Chart1.Value(1, 0) = 75

  Chart1.Value(1, 1) = -50

 

  Chart1.CloseData COD_Values

  'Set panes

  Dim ax As Axis

  Set ax = Chart1.Axis(YAxis_Main)

  ax.Pane = 0

  Chart1.Series(0).YAxis = YAxis_Main

 

  Set ax = Chart1.Axis(3)

  ax.YAxis = True

  ax.Position = AxisPosition_Near

  ax.Pane = 1

  Chart1.Series(1).YAxis = 3

 

  Chart1.RecalcScale

 

  Chart1.Panes(0).Title.text = "First pane"

  Chart1.Panes(1).Title.text = "Second pane"

ChartFx.zip

Link to post
Share on other sites
  • 5 years later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...