0

I am currently working with visifire on a c# charting project.

I want to create a bar chart to show percental increase as green bars and decreases as red bars. The Axis / 0 point line should always remain at the same position.

The problem is, that the axis currently moves all around the screen depending on the values that are shown. (see the image below)

axis stuck on the right side

I already tried to center it with axismaximum and axisminimum set to fix values, but that doesn't work.

The way i want it to be is like this. single color / only negative

or this

positive and negative values

Are there any remaining visifire cracks out there, that can understand the problem and help?

4

2 回答 2

1

One workaround for this is finding the maximum value (absolute value, using Math.Abs) from the series, then adding its counter value to the beginning of series.

For example, if the maximum absolute value is -80%, then add a +80%. In this way, the axis can be centred.

You can use a special colour (Transparent?) for the first bar, or use other control to cover it so user will only see the real data.

于 2016-01-19T17:57:14.233 回答
0

Using data bindings, this should do the trick. MinValue = -MaxValue

<vc:Chart.AxesY >
       <vc:Axis AxisMaximum="{Binding MinValue}" AxisMinimum="{Binding MaxValue}" Enabled="False" AxisType="Primary" >

       </vc:Axis>
 </vc:Chart.AxesY>

Otherwise this is the same without databinding

<vc:Chart.AxesY >
       <vc:Axis AxisMaximum="70" AxisMinimum="-70" Enabled="False" AxisType="Primary" >

       </vc:Axis>
 </vc:Chart.AxesY>
于 2016-01-20T22:36:50.290 回答