0

我在我的代码中渲染了一个条形图,但由于我有太多的 x 轴数据点,所以工具提示没有显示。有人可以在这里帮忙吗?

我的代码是:

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];
}

样本xAndyVals[0, 152518],其中0是 x 轴值,152158是 y 轴值。

4

0 回答 0