An SVG Line chart using a logarithmic scale

This goes in the documents header:
<script src="../libraries/RGraph.svg.common.core.js" ></script>
<script src="../libraries/RGraph.svg.line.js" ></script>
Put this where you want the chart to show up:
<script>
    data = [0,10,0,100,0,1000,0,10000,0,100000];
    
    for (var i=0; i<data.length; ++i) {
        if (data[i] > 0) {
            data[i] = RGraph.SVG.log({num:data[i], base: 10});
        }
    }

    new RGraph.SVG.Line({
        id: 'chart-container',
        data: data,
        options: {
            xaxisLabels: ['','A','','B','','C','','D','','E'],
            yaxisScale: false,
            yaxisLabels:['0','10','100','1,000','10,000','100,000','1,000,000'],
            gutterLeft: 100,                
            backgroundGridHlinesCount: 6,
            yaxisLabelsCount: 6,
            yaxisMin: 0,
            yaxisMax: 6,
            linewidth: 3,
            yaxis: false,
            xaxis: false,
            backgroundGridVlines: false,
            backgroundGridBorder: false
        }
    }).trace();
</script>

« Back