Question

I am using this code to create my bar chart.

var plot1 = $.jqplot('fidtenuredivid', [line1], {
            title: '%%K_CATEGORY_VS_AMOUNT%%',
            animate: !$.jqplot.use_excanvas,
            seriesDefaults:{
            renderer:$.jqplot.BarRenderer,
            pointLabels: { show: true,
                      stackedValue: true},
            color: "#00749F"
        },
            axes: {
              xaxis: {
                renderer: $.jqplot.CategoryAxisRenderer
              }
            }
          });

But i want it should show Black circle mark as default value for the each category.

Was it helpful?

Solution

It can be achieved. Jsfiddle example

Please find below the sample code which does that, you can use this concept in your code.

 $(document).ready(function () {
    var defaults = [
        ['2014-01-15 15:10:01', 15],
        ['2014-01-15 15:10:12', 10],
        ['2014-01-15 15:10:14', 5],
        ['2014-01-15 15:10:17', 19],
        ['2014-01-15 15:10:23', 15],
        ['2014-01-15 15:10:28', 12]
    ];

    var bars = [
        ['2014-01-15 15:10:01', 21],
        ['2014-01-15 15:10:12', 21],
        ['2014-01-15 15:10:14', 22],
        ['2014-01-15 15:10:17', 21],
        ['2014-01-15 15:10:23', 22],
        ['2014-01-15 15:10:28', 18]
    ];

    var plot1 = $.jqplot('chart1', [bars, defaults], {
        title: 'Default Date Axis',
        axes: {
            xaxis: {
                renderer: $.jqplot.CategoryAxisRenderer
            }
        },
        series: [{
            renderer: $.jqplot.BarRenderer,
            pointLabels: {
                show: true,
                stackedValue: true
            },
            color: "#00749F",
            label: "peer expenses"
        }, {
            lineWidth: 1,
            showLine: false,
            markerOptions: {
                style: 'filledCircle',
                size: 40
            },
            label: "Expenses"
        }],
        legend: {
            show: true,
            location: 'e',
            placement: "outsideGrid"
        }
    });
});
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top