The chart editor, as seen in Spreadsheet visualizations, can become part of a coded visualization. With the chart editor option, users can set their own style and chart type preferences. The editor is the same editor used by Spreadsheets and Fusion Tables. To make chart editor an option, a button to open the editor must be created in the standard HTML form method.
<input type='button' onclick='openEditor()' value='Open Editor'>
The remaining methods to implement the editor are primarily the same as with other button-controlled charts.
However, one small programming requirement in addition to the editor-specific button itself, is to include the chartedit
library package to be loaded by google.load
.
google.load('visualization', '1', {packages:['charteditor']});
To create the chart itself, the ChartWrapper
class is used. Finally, to alert the application when the editor button has been pushed, an event listener is used. The creation of the listener is in the same...