Uploaded image for project: 'ZK Charts'
  1. ZK Charts
  2. ZKCHARTS-40

setTheme methods too restrictive

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • 2.1.1
    • 2.1.0
    • None

      the setTheme() (e.g. DrillUpButton.setTheme()) methods no longer support nested styles

      e.g. this style config cannot be expressed as a Map<String, String>

      "theme":{"fill":"#E8E8EA",
                     "stroke":"#6E6E78",
                     "stroke-width":"1",
                     "r":"0",
                    "states":{
                                  "hover":{
                                           "fill":"#F4F4F6",
                                           "stroke":"#6E6E78",
                                           "stroke-width":"1",
                                           "r":"0"}},
                    "style":{
                              "color":"#4D5663",
                              "fontSize":"12px",
                              "fontFamily": "'Arial'",
                             "fontWeight":"normal",
                            "padding":"10px"}
      }
      

      a Workaround is to use addExtraParams() passing in the config as a JSON object directly

      JSONAware themeParams = (JSONAware) JSONValue.parse("{\"fill\":\"#E8E8EA\", \"stroke\":\"#FF6E78\", \"stroke-width\":\"1\", \"r\":\"0\", \"states\":{ \"hover\":{ \"fill\":\"#F400F6\", \"stroke\":\"#6E6E78\", \"stroke-width\":\"1\", \"r\":\"0\"}}, \"style\":{ \"color\":\"#4D5663\", \"fontSize\":\"12px\", \"fontFamily\": \"'Arial'\", \"fontWeight\":\"normal\", \"padding\":\"10px\"}}");
      drillUpButton.addExtraAttr("theme", themeParams);
      

            christopherszu christopherszu
            cor3000 cor3000
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 6 hours
                6h