the current theme is connected with
dojo.require("dojox.charting.themes.PlotKit.green");I created my theme, saved it in the same folder and tried to add to page:
dojo.require("mytheme");But it's not connecting this way.
the current theme is connected with
dojo.require("dojox.charting.themes.PlotKit.green");I created my theme, saved it in the same folder and tried to add to page:
dojo.require("mytheme");But it's not connecting this way.
If you created your own module, the easiest thing to do is to place it in the folder, which is a peer of dojo
:
dojo/...
dijit/...
dojox/...
my/... <- your file goes there
For example, it is called "mytheme". In this case it should go into my/mytheme.js
file. In order to use it just require it and set on your chart:
dojo.require("my.mytheme");
...
chart.setTheme(my.mytheme);
Don't forget to put dojo.provide("my.mytheme");
at the top of your theme file, and define my.mytheme
object (your theme).
Alternatively include it inline like I did in http://lazutkin.com/download/hicharts.html (look for myTheme
). Or you can include the snippet using a regular <script>
tag.
Do not forget to set your new theme explicitly on a chart: chart.setTheme(your_theme_object)
.