【问题标题】:How to set title as html for jqplot graphs如何将标题设置为 jqplot 图形的 html
【发布时间】:2012-08-09 11:13:31
【问题描述】:

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

【问题讨论】:

  • 还有你使用 jqplot 选项的代码?
  • 让我发布一个示例,我还需要帮助我在线性图上显示我的自定义工具提示。 @MichaelSwan
  • 在发送之前尝试将 html 转换为 ASCII,这样 html 不应该呈现。

标签: jquery mobile jquery-mobile cordova jqplot


【解决方案1】:
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"
                    }
                }
            });

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2013-09-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-07-22
    • 1970-01-01
    相关资源
    最近更新 更多