Ejemplo n.º 1
0
 public Feature()
 {
     mark        = new Mark();
     dataView    = new DataView();
     magicType   = new MagicType();
     restore     = new Restore();
     saveAsImage = new SaveAsImage();
 }
Ejemplo n.º 2
0
        /// <summary>
        /// 组件初始化
        /// </summary>
        /// <param name="option"></param>
        private void OptionComponent(Option option)
        {
            EChartsComponentTitle title = new EChartsComponentTitle { Text = "hello World", Subtext = "UglyMelon007" };
            option.Title = title;

            EChartsComponentTooltip tooltip = new EChartsComponentTooltip { Trigger = "axis" };
            option.Tooltip = tooltip;

            EChartsComponentLegend legend = new EChartsComponentLegend();
            LegendData legendData = new LegendData { Name = "最高温度" };
            legend.Data = new[] { legendData };
            option.Legend = legend;

            EChartsComponentAxis xAxis = new EChartsComponentAxis { Type = "category", BoundaryGap = "false" };
            xAxis.Data = new[] {
                new AxisData{Value ="Monday"}, 
                new AxisData{Value ="Tuesday"},
                new AxisData{Value="Wednesday"},
                new AxisData{Value = "Thursday"},
                new AxisData{Value = "Friday"},
                new AxisData{Value = "Saturday"},
                new AxisData{Value = "Sunday"}
            };
            option.XAxis = xAxis;

            EChartsComponentAxis yAxis = new EChartsComponentAxis { Type = "value" };
            AxisLabel axisLabel = new AxisLabel { Formatter = "{value} °C" };
            yAxis.AxisLabel = axisLabel;
            option.YAxis = yAxis;

            EChartsComponentToolbox toolbox = new EChartsComponentToolbox();
            toolbox.Show = "true";
            Feature feature = new Feature();
            Mark mark = new Mark { Show = "true" };
            DataView dataView = new DataView { Show = "true", ReadOnly = "false" };
            MagicType magicType = new MagicType { Show = "true", Type = new[] { "line", "bar" } };
            Restore restore = new Restore { Show = "true" };
            SaveAsImage saveAsImage = new SaveAsImage { Show = "true" };
            feature.Mark = mark;
            feature.DataView = dataView;
            feature.MagicType = magicType;
            feature.Restore = restore;
            feature.SaveAsImage = saveAsImage;
            toolbox.Feature = feature;
            option.Toolbox = toolbox;
        }
Ejemplo n.º 3
0
 private void SaveAsImageInvoke() => SaveAsImage.InvokeAsync();
Ejemplo n.º 4
0
        /// <summary>
        /// 组件初始化
        /// </summary>
        /// <param name="option"></param>
        private void OptionComponent(Option option)
        {
            EChartsComponentTitle title = new EChartsComponentTitle {
                Text = "hello World", Subtext = "UglyMelon007"
            };

            option.Title = title;

            EChartsComponentTooltip tooltip = new EChartsComponentTooltip {
                Trigger = "axis"
            };

            option.Tooltip = tooltip;

            EChartsComponentLegend legend     = new EChartsComponentLegend();
            LegendData             legendData = new LegendData {
                Name = "最高温度"
            };

            legend.Data   = new[] { legendData };
            option.Legend = legend;

            EChartsComponentAxis xAxis = new EChartsComponentAxis {
                Type = "category", BoundaryGap = "false"
            };

            xAxis.Data = new[] {
                new AxisData {
                    Value = "Monday"
                },
                new AxisData {
                    Value = "Tuesday"
                },
                new AxisData {
                    Value = "Wednesday"
                },
                new AxisData {
                    Value = "Thursday"
                },
                new AxisData {
                    Value = "Friday"
                },
                new AxisData {
                    Value = "Saturday"
                },
                new AxisData {
                    Value = "Sunday"
                }
            };
            option.XAxis = xAxis;

            EChartsComponentAxis yAxis = new EChartsComponentAxis {
                Type = "value"
            };
            AxisLabel axisLabel = new AxisLabel {
                Formatter = "{value} °C"
            };

            yAxis.AxisLabel = axisLabel;
            option.YAxis    = yAxis;

            EChartsComponentToolbox toolbox = new EChartsComponentToolbox();

            toolbox.Show = "true";
            Feature feature = new Feature();
            Mark    mark    = new Mark {
                Show = "true"
            };
            DataView dataView = new DataView {
                Show = "true", ReadOnly = "false"
            };
            MagicType magicType = new MagicType {
                Show = "true", Type = new[] { "line", "bar" }
            };
            Restore restore = new Restore {
                Show = "true"
            };
            SaveAsImage saveAsImage = new SaveAsImage {
                Show = "true"
            };

            feature.Mark        = mark;
            feature.DataView    = dataView;
            feature.MagicType   = magicType;
            feature.Restore     = restore;
            feature.SaveAsImage = saveAsImage;
            toolbox.Feature     = feature;
            option.Toolbox      = toolbox;
        }