ASE Home Page Products Download Purchase Support About ASE
ChartDirector Support
Forum HomeForum Home   SearchSearch

Message ListMessage List     Post MessagePost Message

  Bar Chart - Scaling
Posted by Mark on Jun-23-2020 01:27
Attachments:
            // datapoints
            double[] data = { 97.3, 2.5, 2.3, 1.2, 2.2, 1, -.9, -1, 3, -1 };

            // We want to plot a waterfall chart al
            string[] labels = {"Unconstrained Forecast", "NPI", "NPI - Ramp up", "New Sales Project", "Existing Business Growth", "Price Increase", "Price Eronsion"
                , "EOL", "Market Tailwinds", "Market Headwindss", "Unconstrained Forecast", "Unconstrained Forecast"};


            double[] boxTop = new ArrayMath(data).insert2(0, 1).acc().result();
            double[] boxBottom = new ArrayMath(boxTop).shift(1, 0).result();
            boxBottom[boxBottom.Length - 1] = 0;
            BoxWhiskerLayer layer = c.addBoxWhiskerLayer2(boxTop, boxBottom);

            //// Put data labels on the bars to show the cash flow using Arial Bold font
            layer.setDataLabelFormat("{={top}-{bottom}}M");
            layer.setDataLabelStyle("Arial Bold").setAlignment(Chart.Center);

            c.yAxis().setLinearScale(90, 120);


is there a way to start the bar chart at say 90, but not have the bar go below the chart? area... due to scaling the start and end points are large numbers, we want to keep things in line

Thanks
Mark
Forecast.png

  Re: Bar Chart - Scaling
Posted by Peter Kwan on Jun-23-2020 11:12
Hi Mark,

You can use:

c.setClipping();

This is clip the chart layers to the plot area.

Hope this can help.

Regards
Peter Kwan