Software FX Community

# Re: Floating Bars

## Recommended Posts

```Bruce,
Re-thinking my fix for your floating bars...
I was checking the values shown by "hovering" over the bars and I'm confused again!  The 4th series shows "From 10 to 20" but draws the series to 30.
Very Courious!
Steve
SteveT <SteveT@NoMail.com> wrote in message news:DE0379D14694D211B4CE00609770710D04579E@sftfx-221.wamnet.net...
> Bruce,
>
> One of the "tricks" I learned from Francisco was to turn on the DataEditor.
> This will allow you to see the actual values of the series.
> Your code creates values of -10, 0 ,10, 20.
>
> 20 ON 10 IS 30, hence your top value of 30 in the chart.
>
> I think the problem in this code is in your last series:
> "ChartFX.ValueEx(3, 0) = 20"
> The sample is to create a floating bar chart starting with -20 and stack
> values of 10 on top.
> Your 4th series is valued at 20, not 10.  I can read the code and understand
> what you mean but poor computer...
>
> I recently had some questions regarding the YFrom settings and had to write
> some special code to check my data series.  I couldn't count on positive or
> negative numbers for a floating bar chart and had to check each series
> begining and ending point to see how to insert the values into the arrays.
>
>
> Steve
>
>
> Just for fun, using the code you provided, converted to VBA (Access 2000)
> the code looks like:
>
> ***************************
>
>     Dim ChartFX As Object
>     Set ChartFX = Me.Chart1
>
>
>     ChartFX.OpenDataEx COD_VALUES, 4, 1
>     ChartFX.OpenDataEx COD_INIVALUES, 4, 1
>
>     ChartFX.ValueEx(0, 0) = -10
>     ChartFX.IniValueEx(0, 0) = -20
>
>     ChartFX.ValueEx(1, 0) = 0
>     ChartFX.IniValueEx(1, 0) = -10
>
>     ChartFX.ValueEx(2, 0) = 10
>     ChartFX.IniValueEx(2, 0) = 0
>
>     ChartFX.ValueEx(3, 0) = 10 'corrected from 20
>     ChartFX.IniValueEx(3, 0) = 10
>
>     ChartFX.CloseData (COD_INIVALUES)
>     ChartFX.CloseData COD_VALUES
>
>     ChartFX.Stacked = CHART_STACKED
>     ChartFX.Axis.Item(AXIS_Y).Max = 60
>     ChartFX.Axis.Item(AXIS_Y).Min = -60
>     ChartFX.Axis.Item(AXIS_Y).Grid = True
>
>     ChartFX.DataEditor = True
>
>     Set ChartFX = Nothing
>
> ***************************
>
>
> -----Original Message-----
> Sent: Thursday, December 30, 1999 7:40 AM
> To: 'Steve Titus'
> Subject: RE: Removing Zero Line Programmatically
>
>
> Thanks, Steve. Using the AS_FORCEZERO removes those zero lines like I want
> them to.
>
> I have been having another problem that I was wondering if you could help me
> with. I have emailed Francisco with this problem, as well as sent one to
> general support and have not gotten a response.
>
> I am trying to implement a floating, stacked bar chart using the code below:
>
>    m_pChartFX->Stacked = CHART_STACKED;
>    m_pChartFX->OpenDataEx(COD_VALUES, 4, 1);
>    m_pChartFX->OpenDataEx(COD_INIVALUES, 4, 1);
>    m_pChartFX->IniValueEx[0][0] = -20;
>    m_pChartFX->ValueEx[0][0] = -10;
>    m_pChartFX->IniValueEx[1][0] = -10;
>    m_pChartFX->ValueEx[1][0] = 10;
>    m_pChartFX->IniValueEx[2][0] = 0;
>    m_pChartFX->ValueEx[2][0] = 10;
>    m_pChartFX->IniValueEx[3][0] = 10;
>    m_pChartFX->ValueEx[3][0] = 10;
>    m_pChartFX->CloseData(COD_VALUES);
>    m_pChartFX->CloseData(COD_INIVALUES);
>    m_pChartFX->Axis->Item[AXIS_Y]->Min = -60;
>
>
> Basically, there is just one stacked-bar in the chart, with 4 series. I want
> it to start at -20 and extend to 20, with each series being of size 10. Now,
> using the above code, all series EXCEPT for the 4th (topmost) series is of
> size 10. Now, as you can see in the attached chart, the topmost series
> extends from 10 to 30, even though I specify it having size 10:
>
> m_pChartFX->ValueEx[3][0] = 10;
>
>
> Now, one important thing to note is that I only have this problem when I use
> negative values for the ValueEx and the IniValueEx. If the values are ALL
> positive, the above code works just fine. As soon as they go negative,
> however, I have problems like the one presented here.
>
> What is going on here? Am I doing something wrong?
>
>
>
>
> -----Original Message-----
> From: Steve Titus [ mailto:stephent@hevanet.com]
> Sent: Wednesday, December 29, 1999 9:13 PM
> Subject: Re: Removing Zero Line Programmatically
>
>
> Bruce,
>
> In the UI reference if you click the Axes tab then details it takes you to:
>
> ChartName.Axis(AxisName).Style property
>
> seems this is toggled with:
>
> ChartName.Axis(AxisName).Style = AS_BREAKZERO
>
> and
>
> ChartName.Axis(AxisName).Style = AS_FORCEZERO
>
>
> Steve
>
> news:DE0379D14694D211B4CE00609770710D045786@sftfx-221.wamnet.net...
> > I seem to be unable to find a property with the axis object to remove the
> > zero lines from my chart. I can do it with the property dialog by going to
> > the Axes tab, then clicking on Details and then clicking off the zero
> line.
> >
> > Anyone out there know of a way to do this programmatically? I am using
> VC++,
> > but sample code of any sort would be appreciated.
> >
> > Thanks
> >
> >
>
>
>
>
>
>
>
>```

#### Archived

This topic is now archived and is closed to further replies.

×