Navigation: Helper Classes >

GoogleChartOptions

 

 

 

 

 

GoogleChartOptions is a helper class that is used to configure a Google chart that is linked to the data in a DbNetGridCore grid it has the following properties

 

public class GoogleChartOptions

{

    public GoogleChartType Type { get; set; }

    public string PanelId { get; set; }

    public string FunctionName { get; set; }

}

 

GoogleChartType(enum)

 

public enum GoogleChartType

{

    AreaChart,

    BarChart,

    BubbleChart,

    CandlestickChart,

    ColumnChart,

    ComboChart,

    Histogram,

    LineChart,

    PieChart,

    ScatterChart,

    SteppedAreaChart

}

 

     PanelId (string)

 

The Id of the HTML element that will act as the container for the chart :

  

FunctionName(enum)

 

The name of the client-side JavaScript function that will be used to set the grid options. This function will be called just before the chart is rendered and can be used to set the Google chart options which are passed into the function as an empty object along with a reference to the cliend-side grid instance e.g.

 

...

productSalesSummaryGrid.GoogleChartOptions = new GoogleChartOptions() { Type = GoogleChartType.PieChart, PanelId = "piechart", FunctionName = "chartOptions" };

...
<script type="text/javascript">

function chartOptions(grid, options) {

   options.is3D = true;

   options.chartArea = { width: '90%', height: '90%' };

   options.width = 300;

   options.height = 250;

}

</script>
...

 

 

 

Copyright © 2023 DbNetLink