I added a new chart to the dashboard and that's a short description of the way i did it. i am not sure if this is what you are looking for and it surely isn't the most elegant way but at least it adds a new chart
What I would like to know is how to add a new chart without the risk of losing it with the next upgrade.
ok and here is what i did to add a new chart:
1.copy one of the chart files in modules/Charts/code
2.rename it (for example: Chart_mychart.php)
3.go into “predefined_charts.php” in modules/Charts/code and add new entry to $predefined_charts array: 'Chart_mychart' => array('type'=>'code','id'=>'Chart_mychart','label' =>'My Chart')
4.go to your newly created “Chart-mychart.php” and replace all “original_chart”-variables with your “mychart”-term
5.in modules/Charts/language/en_us.lang.php (or whatever language file you are using) you'll find variables to set titles and descriptions of your new chart. You need to search for the affected variables and add your names (e.g. LBL_MYCHART_TITLE and the value for it) and adjust the variables in the “Chart-mychart.php”
6.go to your sugar system and open dashboard
7.“your chart” should now be visible in the “add a chart”-dropdown (the name in the menu is the “label” value you add in “predefined_charts.php)
8.once your new chart is visible you can go on adding the required functionality to your file or adjusting the existing one)
9.the function ‘gen_xml’ generates the XML that is used to create the Flash-chart
10.create_chart at the very end of the file defines the type of chart being displayed
11.the .fla-files are saved in include/charts
rgds, velocitygirl
Bookmarks