Exemple #1
0
partial         void OnChartChanging(ChartAnswer value);
Exemple #2
0
 public void RefreshData(ChartAnswer answer)
 {
     Answer = answer;
     foreach (VisibloxChartSerie serie in ChartSeries) {
         try {
             ChartDataSerie serieData=answer.Data.Series[answer.Data.SeriesNames[serie.TagName]];
             serie.refresh(serieData);
         } catch { }
     }
 }
Exemple #3
0
        protected void processChartAnswer(ChartAnswer chartAnswer)
        {
            Answer = chartAnswer;
            ChartData data=Answer.Data;
            ChartProperties prop=Answer.Properties;

            CreateChart();
            switch (XAxesType) {
                case XAxisTypeEnum.numeric:
                    CurrentChart.XAxis = new LinearAxis();
                    break;
                case XAxisTypeEnum.datetime:
                    CurrentChart.XAxis = new DateTimeAxis();
                    break;
            }
            CurrentChart.XAxis.LabelFormatString = XAxesForamtString;

            LinearAxis hiddenYAxis=new LinearAxis();
            hiddenYAxis.Visibility = Visibility.Collapsed;
            CurrentChart.AdditionalSecondaryYAxes.Add(hiddenYAxis);
            Axes = new Dictionary<int, LinearAxis>();
            AxesVisible = new Dictionary<int, Dictionary<string, bool>>();
            foreach (ChartAxisProperties ax in chartAnswer.Properties.Axes) {
                LinearAxis axis=new LinearAxis();
                axis.AutoScaleToVisibleData = ax.Auto;

                axis.LabelFormatString = "#,0.##";
                axis.ShowGridlines = ax.Index == 0;

                if (ax.Interval != 0) {
                    axis.MajorTickInterval = ax.Interval;
                }
                if (!ax.Auto) {
                    axis.Range = new DoubleRange(ax.Min, ax.Max);
                }

                if (ax.Index > 1) {
                    CurrentChart.AdditionalSecondaryYAxes.Add(axis);
                }
                Axes.Add(ax.Index, axis);
                AxesVisible.Add(ax.Index, new Dictionary<string,bool>());
            }

            CurrentChart.YAxis = Axes[0];
            CurrentChart.SecondaryYAxis = Axes[1];

            ChartSeries = new List<VisibloxChartSerie>();
            foreach (ChartSerieProperties serieProp in prop.Series) {
                try {
                    ChartDataSerie serieData=chartAnswer.Data.Series[chartAnswer.Data.SeriesNames[serieProp.TagName]];
                    VisibloxChartSerie chartSerie=new VisibloxChartSerie(this);
                    chartSerie.init(serieData, serieProp);
                    ChartSeries.Add(chartSerie);
                    chartSerie.Enabled = true;
                } catch {
                }
            }

            this.InvalidateArrange();
            LegendGrid.ItemsSource = ChartSeries;

            foreach (VisibloxChartSerie serie in ChartSeries) {
                try {
                    ChartSerieProperties props=chartAnswer.Properties.Series[chartAnswer.Properties.SeriesNames[serie.TagName]];
                    serie.Enabled = props.Enabled;
                } catch {
                }
            }
        }
Exemple #4
0
 public void Create(ChartAnswer answer)
 {
     processChartAnswer(answer);
 }
Exemple #5
0
 public virtual ChartAnswer getChart()
 {
     ChartAnswer answer=new ChartAnswer();
     answer.Data = new ChartData();
     writeFaktData(answer.Data);
     Prognoz.AddChartData(answer.Data);
     answer.Properties = Prognoz.createChartProperties();
     return answer;
 }