【问题标题】:How change the theme of a timeseries plots in FusionCharts?如何更改 FusionCharts 中时序图的主题?
【发布时间】:2020-05-10 14:14:11
【问题描述】:

我无法在 Python 项目中更改时间序列图表的主题。我已确保我清除了所有缓存,并且我已将 fusioncharts.theme.candy.js 文件加载到 . 现在,我在导入 fusioncharts 后在我的 Python 文件中执行此操作:

...
timeSeries.AddAttribute('chart', '{}') 
timeSeries.AddAttribute('caption', '{"text":"My Awesome Chart"}') timeSeries.AddAttribute('theme', '{"text":"candy"}') 
timeSeries.AddAttribute('yaxis', '[{"plot":{"value":"kW","connectnulldata":true},"format":{"suffix":"INR"},"title":"Book Sales"}]') 

我的挑战是:我总是得到融合主题,而不是糖果。如何更改主题?

【问题讨论】:

    标签: fusioncharts


    【解决方案1】:

    这是一个例子

     timeSeries.AddAttribute("chart", """{
                        **theme:"candy"**
                       }""")
    

    这是一个纯 js 的演示 - https://jsfiddle.net/bvypxemd/

    ​请检查主题属性是否应用在数据源的图表对象中。

    【讨论】:

      【解决方案2】:

      如果您是在打字稿中制作图表,那么您可以通过简单地在图表生成功能中更改您想要的主题来更改主题。这是代码示例..

      const data = {
        chart: {
          caption: "Fusion Chart",
          "baseFont": "Verdana",
          "baseFontSize": "11",
          xaxisname: "Values",
          yaxisname: "Percentage(%)",
          theme: "candy", // here you need to change the theme
          use3DLighting: 0
        },
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2019-07-21
        • 2014-10-19
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2019-10-03
        • 1970-01-01
        • 2011-07-31
        相关资源
        最近更新 更多