I would like to customise the set of charts that is displayed in the Campaigns “View Status” page, and have reached the limit of my understanding on the subject. I have successfully set up new CustomJit and CustomJitReports classes (subclassed from Jit and JitReports), and used them to point at a new tpl script (and changed the "chart engine to CustomJit in config.php). This is working in so far as I can add anything within the “chartContainer” division, but does not help because all the graph construction is effected by a javascript function, and most of the dimensions etc. seem to be hard-coded into that. I copied the file “include/SugarCharts/Jit/js/sugarCharts.js” to “custom/include/SugarCharts/CustomJit/js/sugarCharts.js” in the hope that the custom version would override the primary one, but that has had no effect. Any help would be most welcome.
Progress made! I did succeed in substituting another javascript file simply by adding at the top of the chart.tpl script the block
which overwrote the loadSugarChart() function, and after a day or two of grappling with this quite daunting script, I was able to change many of the attributes of the chart.
However, the main aim of the exercise, which was to make the chart a bit more compact, I suddenly realised can be achieved without touching the javascript at all! I simply put at the top of my custom chart.tpl script “{assign var = “height” value = 450}”, i.e. ignore whatever arcane method Suite/Sugar uses to calculate the value of that variable. This resizes the chart very nicely and it now looks more consistent in its dimensions with the view page into which it is interpolated, and nicely fits the top panel of the view page plus the chart section into the screen without having to scroll up and down.