SetChartStyle() public méthode

Sets the chart style.
public SetChartStyle ( ChartStyle chartStyle ) : void
chartStyle ChartStyle The chart style.
Résultat void
Exemple #1
0
        private void RegisterStartupScript()
        {
            var options = new ChartOptions();
            options.series = new SeriesOptions( false, true, false );
            options.yaxis = new AxisOptions { min = 0, minTickSize = 1 };
            options.xaxis = new AxisOptions { mode = AxisMode.time };
            options.grid = new GridOptions { hoverable = true, clickable = false };
            options.SetChartStyle( GetAttributeValue( "ChartStyle" ).AsGuidOrNull() );
            options.xaxis.timeformat = "%I:%M";

            string script = string.Format( @"
            var data = eval($('#{1}').val());
            var options = {2};
            $.plot( $('#{0}'), data, options );
            ",
                pnlChart.ClientID, hfChartData.ClientID,
                JsonConvert.SerializeObject(
                    options,
                    Formatting.Indented,
                    new JsonSerializerSettings() {
                        ReferenceLoopHandling = ReferenceLoopHandling.Ignore,
                        NullValueHandling = NullValueHandling.Ignore
                    } ) );

            ScriptManager.RegisterStartupScript( pnlChart, pnlChart.GetType(), "chart", script, true );
        }
Exemple #2
0
        private void SetChartOptions()
        {
            var options = new ChartOptions();
            options.series = new SeriesOptions( false, true, false );
            options.xaxis = new AxisOptions { mode = AxisMode.time };
            options.grid = new GridOptions { hoverable = true, clickable = false };

            options.SetChartStyle( GetAttributeValue( "ChartStyle" ).AsGuidOrNull() );

            options.xaxis.timeformat = "%I:%M";

            hfChartOptions.Value = JsonConvert.SerializeObject( options, Formatting.Indented, new JsonSerializerSettings() { ReferenceLoopHandling = ReferenceLoopHandling.Ignore, NullValueHandling = NullValueHandling.Ignore } );
        }
Exemple #3
0
        private void RegisterStartupScript()
        {
            var options = new ChartOptions();
            options.series = new SeriesOptions( false, true, false );
            options.yaxis = new AxisOptions { min = 0, minTickSize = 1 };
            options.xaxis = new AxisOptions { mode = AxisMode.time };
            options.grid = new GridOptions { hoverable = true, clickable = false };
            options.SetChartStyle( GetAttributeValue( "ChartStyle" ).AsGuidOrNull() );
            options.xaxis.timeformat = "%I:%M";

            string script = string.Format( @"
            var data = eval($('#{1}').val());
            var options = {2};
            $.plot( $('#{0}'), data, options );

            $('.js-threshold-btn-edit').click(function(e){{
            var $parentDiv = $(this).closest('div.js-threshold');
            $parentDiv.find('.js-threshold-nb').val($parentDiv.find('.js-threshold-hf').val());
            $parentDiv.find('.js-threshold-view').hide();
            $parentDiv.find('.js-threshold-edit').show();
            }});

            $('a.js-threshold-edit').click(function(e){{
            var $parentDiv = $(this).closest('div.js-threshold');
            $parentDiv.find('.js-threshold-edit').hide();
            $parentDiv.find('.js-threshold-view').show();
            return true;
            }});

            $('.js-threshold').click(function(e){{
            e.stopPropagation();
            }});
            ",
                pnlChart.ClientID, hfChartData.ClientID,
                JsonConvert.SerializeObject(
                    options,
                    Formatting.Indented,
                    new JsonSerializerSettings()
                    {
                        ReferenceLoopHandling = ReferenceLoopHandling.Ignore,
                        NullValueHandling = NullValueHandling.Ignore
                    } ) );

            ScriptManager.RegisterStartupScript( pnlChart, pnlChart.GetType(), "chart", script, true );
        }