JQPlot Stacked Bar Chart with Label/Ticks inside the series

267 views
Skip to first unread message

Sivaramaiah Suryadevara

unread,
May 28, 2016, 6:41:55 AM5/28/16
to jqplot-users
hi,

my code is as follows:

 $('#chart2').css('width', 1200);

//array with name, data and unique number for name.

arryData.push([ 'Depat1', 2000,10],['Dept2j',3000,11]);

arryData1.push([ 'Dept1', 8000,10],['Dept2',11000,11]);

LegendLables = ['Male', 'Female'];
plot2 = $.jqplot('chart2', [arryData, arryData1], {
                            labelsFromSeries: true,
                            stackSeries: true,
                            seriesColors: ['#156AEA', '#D9432F', '#FFB404', '#0092B9', '#556B2F', '#9932CC', '#808000', '#FF4500', '#574757', '#DAA520', '#20B2AA', '#00FA9A'],
                            seriesDefaults: {
                                renderer: $.jqplot.BarRenderer,
                                
                                pointLabels: {
                                    labelsFromSeries: true,
                                    show: true,
                                    hideZeros: true,
                                    stackedValue: true
                                },
                                rendererOptions: {
                                    fillToZero: true,
                                    barDirection: 'vertical'                                   
                                }
                            },
                            legend: {
                                renderer: $.jqplot.EnhancedLegendRenderer,
                                show: true,
                                location: 's',
                                labels: LegendLables,
                                background: 'transparent',
                                placement: "outsideGrid",
                                marginBottom: "-10px",
                                fontFamily: 'Arial',
                                fontSize: '10pt',
                                textColor: "#000000",
                                border: 'none',
                                rendererOptions: {
                                    numberRows: 1,
                                    numberColumns: 2,
                                }
                            },
                            grid: {
                                backgroundColor: '#ffffff'
                            },
                            axesDefaults: {
                                tickRenderer: $.jqplot.CanvasAxisTickRenderer,
                                tickOptions: {
                                    angle: -30,
                                    fontSize: '10pt'
                                }
                            },
                            axes: {
                                xaxis: {
                                    min: 0,
                                    renderer: $.jqplot.CategoryAxisRenderer //,
                                    //ticks: arryTitle
                                },
                                yaxis: {
                                    padMax: 1.2,
                                    padMin: 1.2,
                                    min: 0,
                                    tickOptions: { showGridline: true, formatString: '%.2f' }
                                }
                            }
                        });


which is not showing anything. if i set stackSeries to False, then the two bars are showing. please help me.





Reply all
Reply to author
Forward
0 new messages