private static HighCharts GetUserEngagementHighChartsData()
        {
            var highChartsStyle = new HighChartsStyle()
            {
                color = "#000000", fontWeight = "normal"
            };


            return(new HighCharts("User Engagement")
            {
                async = false,
                content = "options",
                title = new HighChartsTitle()
                {
                    text = ""
                },

                options = new HighChartsOptions(HighChartType.Spline)
                {
                    xAxis = new HighChartsXAxis()
                    {
                        gridLineWidth = 0,
                        categories = new List <string> {
                            "1",
                            "2",
                            "3",
                            "4"
                        },
                        labels = new HighChartsAxisLabels()
                        {
                            style = highChartsStyle
                        }
                    },
                    yAxis = new HighChartsYAxis()
                    {
                        gridLineWidth = 1,
                        labels = new HighChartsAxisLabels()
                        {
                            align = "right",


                            style = highChartsStyle
                        },
                        title = new HighChartsTitle()
                        {
                            text = "test"
                        },
                        gridLineColor = "#8C8C8C",
                    },
                    series = new List <HighChartsSeries> {
                        new HighChartsSeries()
                        {
                            name = "Logins",
                            data = new List <int> {
                                24,
                                30,
                                22,
                                30
                            },
                            color = "#2D5F91", type = ""
                        },
                    }, credits = new HighChartsCredits()
                    {
                        enabled = false
                    }
                },
                type = HighChartsExportFormat.png, width = 500, scale = null, constr = null
            });
        }
示例#2
0
        private HighCharts GetLoadNewTempReadingChart(int imageHeight, int imageWidth, int imageScale, string chartTitle, string chartType, long xAxisMinValue, long xAxisMaxValue, double?yAxisInterval, List <HighChartsSeries> series, string yAxistitle)
        {
            try
            {
                var highChartsStyle = new HighChartsStyle()
                {
                    color = "#000000", fontWeight = "normal"
                };

                return(new HighCharts()
                {
                    async = false,
                    content = "options",
                    title = new HighChartsTitle()
                    {
                        text = chartTitle,
                        x = -20, //center
                        style = new HighChartsStyle()
                        {
                            fontSize = "16pt",
                        }
                    },

                    options = new HighChartsOptions(chartType)
                    {
                        credits =
                        {
                            enabled = false
                        },
                        boost =
                        {
                            enabled = false,
                        },
                        lang =
                        {
                            noData = "No data to display in this date range"
                        },
                        noData = new HighChartsNoData()
                        {
                            style = new HighChartsStyle()
                            {
                                fontWeight = "normal",
                                fontSize = "18px",
                                color = "#707070"
                            }
                        },
                        exporting = new HighChartsExporting
                        {
                            sourceWidth = imageWidth,
                            sourceHeight = imageHeight,
                            scale = imageScale
                        },
                        xAxis = new HighChartsXAxis()
                        {
                            title = new HighChartsTitle()
                            {
                                //text = "Time (HH:MM DD/MM/YYYY)"
                                text = "Time (hh:mm)"
                            },
                            type = "datetime",
                            dateTimeLabelFormats = new HighChartsDateTimeLabelFormats()
                            {
                                day = "%H:%M"
                            },
                            tickInterval = 3600 * 1000,
                            min = xAxisMinValue,
                            labels = new HighChartsAxisLabels()
                            {
                                y = 30,
                                style = new HighChartsStyle()
                                {
                                    fontSize = "9px !important"
                                }
                            }
                        },
                        plotOptions = new HighChartsPlotOptions()
                        {
                            line = new HighChartsLinePlotOptions()
                            {
                                marker = new HighChartsMarker()
                                {
                                    enabled = false
                                }
                            },
                            series = new HighChartsSeriesPlotOptions()
                            {
                                marker = new HighChartsMarker()
                                {
                                    enabled = false
                                },
                                turboThreshold = 0
                            }
                        },
                        yAxis = new HighChartsYAxis()
                        {
                            gridLineWidth = 1,
                            labels = new HighChartsAxisLabels()
                            {
                                align = "center",
                                format = "{value:.0f}",
                                formatter = null,
                                autoRotation = "[-45]",
                                rotation = "",
                                style = highChartsStyle,
                                y = -10,
                                x = null,
                            },
                            tickInterval = yAxisInterval,
                            gridLineColor = "#8C8C8C",
                            title = new HighChartsTitle()
                            {
                                text = yAxistitle,//"Chiller Power (kW)",
                                //x = 10//-20
                            },
                        },
                        legend = new HighChartsLegend()
                        {
                            layout = "horizontal",
                            //x = 30,
                            align = "center",
                            verticalAlign = "bottom"
                        },
                        series = series,
                    },
                    type = HighChartsExportFormat.png,
                    width = 500,
                    scale = null,
                    constr = null
                });
            }
            catch (Exception ex)
            {
                throw;
            }
        }