コード例 #1
0
 public async Task Reset(Chart.Chart chart)
 {
     if (!_inited)
     {
         await Init();
     }
     if (chart != null)
     {
         Values            = chart.Values;
         Title             = Values.Title;
         SelectedChartType = ChartTypeList.Find(o => o.Value == chart.ChartType);
     }
     else
     {
         Values = new ChartValues
         {
             Title       = "Sample Chart",
             GroupLabels = new List <string>
             {
                 "group 1",
                 "group 2",
                 "group 3",
                 "group 4",
                 "group 5",
                 "group 6",
             },
             LegendItemLabels = new List <string>
             {
                 "legend 1",
                 "legend 2",
                 "legend 3",
                 "legend 4"
             },
             Data = new List <float[]>
             {
                 new float[] { 12, 34, 45, 65, 43, 78 },
                 new float[] { 22, 44, 88, 23, 9, 23 },
                 new float[] { 66, 75, 32, 55, 11, 80 },
                 new float[] { 98, 81, 39, 18, 16, 33 },
             },
             LegendPosition    = LegendPosition.Bottom,
             IsShowTitle       = true,
             IsShowGroupLabels = true,
             IsShowLegend      = true,
             IsShowDataValues  = true
         };
         Title = Values.Title;
         if (LegendPositionList.Count > 0)
         {
             SelectedLegendPosition = LegendPositionList[0];
         }
         if (ChartTypeList.Count > 0)
         {
             SelectedChartType = ChartTypeList[0];
         }
         _inited = true;
     }
 }
コード例 #2
0
 /// <summary>
 /// Constructor for frm_dataradix
 /// </summary>
 public Frm_Dataradix()
 {
     InitializeComponent();
     sourceTypeList   = new SourceTypeList();
     chartTypeList    = new ChartTypeList();
     voInputDataRadix = new VOInputDataRadix();
     setCaptions();
     setStatus();
 }
コード例 #3
0
 public async Task Init()
 {
     LegendPositionList.Add(new KeyValuePair <string, LegendPosition>("Bottom", LegendPosition.Bottom));
     LegendPositionList.Add(new KeyValuePair <string, LegendPosition>("Right", LegendPosition.Right));
     ChartTypeList.Add(new KeyValuePair <string, ChartType>("BarChart", ChartType.Bar));
     ChartTypeList.Add(new KeyValuePair <string, ChartType>("LineChart", ChartType.Line));
     ChartTypeList.Add(new KeyValuePair <string, ChartType>("PieChart", ChartType.Pie));
     _defaultStylePack = new ChartStylePack
     {
         BarChartStyle  = await GetStyleFromFile <BarChartStyle>("ms-appx:///ChartStyle/barChart.json"),
         LineChartStyle = await GetStyleFromFile <LineChartStyle>("ms-appx:///ChartStyle/lineChart.json"),
         PieChartStyle  = await GetStyleFromFile <PieChartStyle>("ms-appx:///ChartStyle/pieChart.json"),
     };
 }