0
votes

I am working with jqPlot's Line chart where data should be displayed for last 12 months. If current month is September then X axis will show 2012 August till 2013 September. However, I have data starting from January 2013. Therefore the lines will start from the middle of the chart till the most recent available month's data.

Problem: Lines are started from the correct position, but the pointables have not moved accordingly. Although the lines show correctly the pointables are shown from beginning of the chart.

enter image description here

Question: How can I move the pointables which should be on the dots instead?

Update: Seems line known issue in jqPlot (issue log)

var json= {    
        title: '' 
        ,stackSeries: false   
        ,captureRightClick: true    
        ,seriesDefaults:{      
            //renderer:$.jqplot.BarRenderer      
            rendererOptions: {                            
                highlightMouseDown: true                             
            }      
            ,pointLabels: {
                show: true
                ,formatString: '%.1f'
                ,seriesLabelIndex:null
                ,hideZeros:true
            }
            ,markerOptions: {
                show: true,    

                style: 'filledCircle',  
            }  
        }  
            ,series: [
                {label: 'A', color:'#FDC12E'}
                ,{label: 'B', color:'#C9198D'}
                ,{label: 'C', color:'#56B9F9'}
                ,{label: 'D', color: '#F1683C'}
                                    ,{label: 'E', color: '#000000'}
            ]

            ,axes: {      
                xaxis: {          
                    tickOptions:{angle:-45}
                    ,tickRenderer: $.jqplot.CanvasAxisTickRenderer
                    ,renderer: $.jqplot.CategoryAxisRenderer
                    ,ticks: []
                },      
                yaxis: {   
                    labelRenderer: $.jqplot.CanvasAxisLabelRenderer
                    ,padMin: 0
                    ,pad: 1.05
                    ,min: 0
                    ,tickOptions:{formatString: '%.0f'},
                } 
            }    
            ,legend: {
                show: true 
                ,location: 's'
                ,placement: 'outsideGrid'
            }
            ,highlighter:{
                show: true
                ,tooltipLocation: 's'
                ,yvalues: 2
                ,bringSeriesToFront:true
                ,showMarker:false
                ,tooltipAxes: 'y'
                ,formatString: "%n%s"
            }
            ,cursor:{
                show: true
                ,zoom:true
                ,showTooltip:false
                ,constrainZoomTo: 'y'
            }
            ,grid:{
                background: '#f8f8f8'
            }               
1

1 Answers

0
votes

I found a workaround until jqPlot fixes their bug. Apparently adding breakOnNull: true to seriesDefaults fixes the issue. This can be used either for pointLabels or for highlighter in JSON part.