Hi,
it seems the problem(see last post) is the pattern value that i have set in
the DataTable, if i remove this, the chart is diplayed correctly.. but in
my old implementation without the ChartWrapper my charts worked with the
pattern value with no problem`s.... Is there a workaround that i can set
the pattern value and the Date value is correct displayed !? or can i set a
customValue in the ColumDescription?
and second question.. as i mentioned in my other post i must sometimes
transforms the data type from "date" to "string" in my old implementation i
have do this like that:
var dataView = new google.visualization.DataView(dataTable);
> dataView.setColumns([{
> type: 'string',
> label: dataView.getColumnLabel(0),
> calc: function (dt, row) {
> return dt.getFormattedValue(row, 0);
> }
> }, 1]);
i have tried the same with a chartWrapper but it doesnt work.. what do i
wrong?
i have tried two approaches:
1.)
> var dataTable=new google.visualization.DataTable(DATA);
> var chartWrapperArgs = {
> chartType: "LineChart",
> dataTable: dataTable,
> view: {"columns":[ { type: 'string', label:
> dataTable.getColumnLabel(0), calc: function (dt, row) { return
> dt.getFormattedValue(row, 0); } }, 1 ]},
> options: options,
> containerId: "chart"]
> };
> var chartWrapper = new google.visualization.ChartWrapper(chartWrapperArgs);
and my second approache:
var dataTable=new google.visualization.DataTable(DATA);
> var dataView = new google.visualization.DataView(dataTable);
> dataView.setColumns([{
> type: 'string',
> label: dataView.getColumnLabel(0),
> calc: function (dt, row) {
> return dt.getFormattedValue(row, 0);
> }
> }, 1]);
>
> var ViewData= dataView.toJSON();
>
> var chartWrapperArgs = {
> chartType: "LineChart",
> dataTable: dataTable,
> view: ViewData,
> options: options,
> containerId: "chart"]
> };
> var chartWrapper = new google.visualization.ChartWrapper(chartWrapperArgs);
but both did not work..
can i not run a calc function with the chartWrapper ?
Am Sonntag, 27. April 2014 21:36:02 UTC+2 schrieb cyb:
>
> Hi,
>
> at the moment i use a switch case for changing different charts like this:
>
> var chart=null;
>> switch (chartType) {
>> case 1:
>> chart=new google.visualization.LineChart(id);
>>
>> break;
>> case 2:
>> chart=new google.visualization.ColumnChart(id);
>>
>> break;
>> }
>> chart.draw(...);
>
>
>
> i have only one chart object for all charts, if i add a error listener
> like this :
>
> google.visualization.events.addListener(chart, 'error', function (err)
> {.....});
>
> must i do this for every chart ? i mean an extra listener for the
> LineChart and one for the ColumChart or can i only create one listener with
> the chart object?
>
>
> or is it better to use a chartWrapper ? if i use a chart wrapper i can add
> only this chartwarapper to the error handler !?
>
> and last question.. the chartWrapper loads the charts dynamicly, but if i
> add this in my code "google.load("visualization", "1", {packages:["table",
> "controls", "corechart","geomap","geochart"]});"
> did the charWrapper then load the charts from my HDD(because the charts
> already loaded) or did he trys to load the charts form the internet ?
>
>
>
>
>
--
You received this message because you are subscribed to the Google Groups
"Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-visualization-api.
For more options, visit https://groups.google.com/d/optout.