【问题标题】:jqPlot not showing x-axis label or formatting axisjqPlot 不显示 x 轴标签或格式化轴
【发布时间】:2013-12-20 14:50:33
【问题描述】:

我正在使用下面的函数生成一个带有两条线的折线图。我的问题是它没有显示 x 轴标签(我已经尝试将它作为变量和硬编码)。它也没有根据 tickOptions 格式化 x 轴值。我有一个单独的图,它在 x 轴上使用日期值而不是常规数字,它没有问题。任何建议将不胜感激。

function toolProbPlot(probDivTitle,probValues,probPlotTitle,probX,legendLabel) {
    return plot = $.jqplot(probDivTitle,probValues, {
        title: probPlotTitle,
        seriesColors:[noColor,yesColor],
        legend: {
            show: true,
            location:  legendLocation,
            placement: legendPlacement,
            labels: legendLabel
        },
        axis: {
            xaxis: {
                labelRenderer: $.jqplot.CanvasAxisLabelRenderer,
                showLabel: true,
                label: probX,
                tickOptions: {formatString: '%.4f'}
            },
            yaxis: {
                labelRenderer: $.jqplot.CanvasAxisLabelRenderer
            }
        }
    });
}

【问题讨论】:

    标签: jquery jqplot


    【解决方案1】:

    错字:axis: { 应该是 axes: {

    还要确保包含所有必需的 .js 插件

    【讨论】:

    • 好吧,那会让你觉得很傻。感谢您指出显而易见的事情!
    猜你喜欢
    • 2020-12-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多