如何将标题设置为jqplot图的html

时间:2012-08-09 11:13:32

标签: jquery mobile jquery-mobile cordova jqplot

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

1 个答案:

答案 0 :(得分: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"
                    }
                }
            });
相关问题