javascript - How to change format between currency and percent in Google Charts? -


I created a chart in the Google Charts. I have a category filter, where I have filters in different years and so on I can do it, and I also have a filter which I can choose which data to compare, but for my question now: How can I make a selected filter that chooses between currency and percentage? As you can see, I have a column filter (selection) at the top, I need "Format filter" which changes vAxis from percentage and currency. Example of work

Here is my code:

  google.setOnLoad callback (draws) Chart); Function drawChart () {var data = google.visualization.arrayToDataTable ([['Date', 'A', 'B', 'C', 'D', 'E'], ['2012 Population', 100, 126] , '' 2012 '', 152, 254, 242, 168, 136], '' 2012 '', 300, 232, 234, 195, 343], ['April 2012', 450, 242, 325, 121, 126], ['Major 2012', 600, 224, 234, 151, 124], 'June 2012, 750, 121, 867, 152, 235],' 2012 Julie ', 900, ['September 2012', 105, 378, 345, 175, 345], ['Oct. 2012', '9th August, 9 56, 566, 267, 457],' [August 2012, 950, 762, 363, 794, 279] 200, 284, 600, 228, 315], ['November 2012', 210, 453, 534, 378, 153], ['December 2012', 205, 166, 536, 274, 315], ['2013 Januari ', 463, 134, 345, 267, 378], [' February 2013 ', 150, 234, 534, 271, 745]]); Var columnTabil = new google.visualization.DataTable (); ColumnsTable.addColumn ('number', 'call index'); ColumnsTable.addColumn ('string', 'colLabel'); Var initState = {Choice: []}; // column for this data table (skip column 0) (var i = 1; i & lt; data. GetNumberOfColumn (); i ++) {columnsTable.addRow ([i, data. GetColumnLabel (i)] ); // If you want to make a default selection in addition to the complete list initState.selectedValues.push (data.getColumnLabel (i)), then you can comment on this next line; } // You can set different columns as default columns (rather than populating through the loop above) such as: //initState.selectedValues.push(data.getColumnLabel(2)); Var dashboard = new google.visualization.dashboard (document.getElementById ('lineDashboard_div')); Var chart = New google.visualization.ChartWrapper ({chart type: 'sketch', container id: 'lineartart_div', data tab: data, option: linewidth option)}; Var columnFilter = new google.visualization.ControlWrapper ({controlType: 'CategoryFilter', containerId: 'LineColumnFilter_div', DataTable: column table, option: {filterColumnLabel: 'collabel', UI: {caption: "compare", label: wrong , AllowTyping: false, allowed majority: true, permission non: false, selected value layout: 'bottom'}}, state: initState}); Var rangeFilter = new google.visualization.ControlWrapper ({controlType: 'NumberRangeFilter', container id: 'lineage filter_design', option: {filterColumnIndex: '1', ui: {showRangeValues: false, label: false}}}); Function setChartView () {var state = columnFilter.getState (); Var line; Var View = {Column: [0]}; (Var i = 0; i  


Comments

Popular posts from this blog

apache - 504 Gateway Time-out The server didn't respond in time. How to fix it? -

c# - .net WebSocket: CloseOutputAsync vs CloseAsync -

c++ - How to properly scale qgroupbox title with stylesheet for high resolution display? -