0
votes

I am creating Column chart with positive and negative values using dojo chart.Here i need my starting values starts from 100 instead of zero .Suppose My values are above 100 then it shows above 100 of bar and similary if my values is below 100 then it shows below of 100 like negatives values shows. Below is my code for

index.php

    dojo.require("dojox.charting.Chart");
    dojo.require("dojox.charting.axis2d.Default");
    dojo.require("dojox.charting.plot2d.ClusteredColumns");
    dojo.require("dojox.charting.themes.Tufte");
    dojo.require("dojox.dtl");
    dojo.require("dojox.dtl.Context");
    charts = [

        {
            description: "Clustered columns with positive and negative  values, readable theme, 1-second animate-in.",
            makeChart: function(node){
                (new dojox.charting.Chart(node)).
                    setTheme(dojox.charting.themes.Tufte).
                    addAxis("x", { fixLower: "minor", fixUpper:  "minor", natural: true }).
                    addAxis("y", { 
                         majorTickStep: 10,
                          max: 150, 
                        vertical: true, fixLower: "major", fixUpper: "major" }).
                    addPlot("default", { type:   "ClusteredColumns", gap: 10, animate: { duration: 1000 } }).
                    addSeries("Series A", [ 120, 110, 107, 115,   121 ] ).
                    addSeries("Series B", [ 80, 90, 75, 85, 62   ] ).
                    render();
            }
        },

    ];
    var now = function(){
        return (new Date()).getTime();
    };


    dojo.addOnLoad(function(){
        var defaultStyle = { width: "400px", height: "200px" };
        var tmpl = new dojox.dtl.Template(dojo.byId("template").value);
        var context = new dojox.dtl.Context({ charts: charts });
        dojo.byId("charts").innerHTML = tmpl.render(context);

        dojo.forEach(charts, function(item, idx){
            var start = now();
            var n = dojo.byId("chart_"+idx);
            dojo.style(n, item.style||defaultStyle);
            item.makeChart(n);
            console.debug((now()-start), "ms to create:", (idx+1)+":", item.description);
        });

So request to you please suggest how can i set my axis label form 100 instead of 0.So that i can configure my charts

1

1 Answers

0
votes

In your code u can add this parameters.

.addAxis("y", {
dropLabels : true,
min : 10,
max : 20,
from: 0,
to:   15
});