0

I am rendering a bar chart in my code but since I have too many x axis data points, the tooltip doesnt show. Can anyone help here?

My code is:

plot = $.jqplot(chartID, [xAndyVals],
{
    title: tempKey,
    seriesDefaults: {
        pointLabels: { show: true },
    },
    series: [{ renderer: $.jqplot.BarRenderer }],
    axesDefaults: {
        tickRenderer: $.jqplot.CanvasAxisTickRenderer,
        tickOptions: {
            angle: -30,
            fontSize: '10pt',
        }
    },
    axes: {
        xaxis: {
            ticks: xTicks,
        },
        yaxis: {
            min: 0,
            max: yMaxVal,
        }
    },
    highlighter: {
        show: true,
        sizeAdjust: 7.5,
        tooltipContentEditor: tooltipContentEditor
    },
    cursor: {
        show: false,
        showTooltip: true
    },
});


function tooltipContentEditor(str, seriesIndex, pointIndex, plot) {
    var plotData = plot.data[seriesIndex][pointIndex];
    var tooltip = mapping.get(plotData[0]);
    return tooltip + ", " + plotData[1];
}

Sample xAndyVals is [0, 152518], where 0 is the x axis value and 152158 is the y axis value.

Kevin Reid
  • 37,492
  • 13
  • 80
  • 108
Kinnary Jangla
  • 123
  • 1
  • 6
  • can you provide some sample values for `xAndyVals` variable. Also share your `tooltipContentEditor` function also. Thats makes it easier to debug for us. – Gyandeep Jan 21 '14 at 20:53
  • Sure. Sample values for xAndyVals is xAndyVals[0] = [0, 152158] xAndyVals[1] = [1, 110859] Here the first value is the x axis value and the 2nd is the y axis value. My tooltipContentEditor function is: //The tooltipContentEditor is used to modify the content of the tooltips so that the tooltips show the non-truncated values of the x-axis labels function tooltipContentEditor(str, seriesIndex, pointIndex, plot) { var plotData = plot.data[seriesIndex][pointIndex]; var tooltip = mapping.get(plotData[0]); return tooltip + ", " + plotData[1]; } – Kinnary Jangla Jan 21 '14 at 21:56
  • When i debug the code, it doesnt hit the tooltipContent editor function – Kinnary Jangla Jan 21 '14 at 22:09
  • please edit your question and place this info. So that its easy for everyone to know about this. If you provide the complete code with the values of all the variables inside your code then it is easy to work on. You have lot of variable in your code, where i dont know what kind of values to assume. Thanks – Gyandeep Jan 21 '14 at 22:15
  • the question has been edited – Kinnary Jangla Jan 21 '14 at 23:16

0 Answers0