-1

如何为 jqplot 图动态设置标题。如果我们设置标题: '<b>My chart</b>' 然后在渲染后 '<b>My chart</b>' 再次显示它应该是 我的图表的位置

4

1 回答 1

0
var plot2 = $.jqplot('chart2', [[3, 7, 9, 1, 4, 6, 8, 2, 5]], {
                // Give the plot a title.
                title: '<b>My Chart<b><br>Date From: 07/07/2012 &nbsp; Date To: 07/21/2012',
                // You can specify options for all axes on the plot at once with
                // the axesDefaults object.  Here, we're using a canvas renderer
                // to draw the axis label which allows rotated text.
                axesDefaults: {
                    labelRenderer: $.jqplot.CanvasAxisLabelRenderer
                },
                // An axes object holds options for all axes.
                // Allowable axes are xaxis, x2axis, yaxis, y2axis, y3axis, ...
                // Up to 9 y axes are supported.
                axes: {
                    // options for each axis are specified in seperate option objects.
                    xaxis: {
                        label: "X Axis",
                        // Turn off "padding".  This will allow data point to lie on the
                        // edges of the grid.  Default padding is 1.2 and will keep all
                        // points inside the bounds of the grid.
                        pad: 0
                    },
                    yaxis: {
                        label: "Y Axis"
                    }
                }
            });
于 2012-08-09T11:24:31.673 回答