private async void DiagrammQHErstellenAsync()
{
await Task.Run(() => DiagrammQH());
}
private void DiagrammQH()
{
//QH Diagramm
chrtKennlinie = diaQH;
chrtKennlinie.Header = "Förderhöhe";
//QH Diagramm
chrtKennlinieUebersichtCode = diaQHUebersicht;
chrtKennlinieUebersichtCode.Header = "Förderhöhe";
//X-Achsen
//Förderhöhe
chrtKennlinie.PrimaryAxis = new NumericalAxis()
{
Header = "Volumenstrom [l/s]",
Minimum = 0,
ShowTrackBallInfo = true
};
//Y-Achsen
//Förderhöhe
NumericalAxis Axis1 = new NumericalAxis()
{
Header = "Förderhöhe [m]",
Minimum = 0,
ShowTrackBallInfo = true
};
chrtKennlinie.SecondaryAxis = Axis1;
//Alle Serien aus Diagramm entfernen
chrtKennlinie.Series.Clear();
foreach (Pumpenmessdaten.MessungenSammlung Item in Vergleichsmessungen)
{
//SERIES
SplineSeries seriesQH = new SplineSeries()
{
IsSeriesVisible = Item.DatenMessung.IsChecked,
ItemsSource = Item.Messwerte,
XBindingPath = "QBerechnet",
YBindingPath = "HtotBerechnet",
ShowTooltip = true,
EnableAnimation = true,
AdornmentsInfo = new ChartAdornmentInfo()
{
Symbol = ChartSymbol.Ellipse,
SymbolWidth = 5,
SymbolHeight = 5
}
};
seriesQH.YAxis = Axis1;
//Adding Series to the Chart Series Collection
chrtKennlinie.Series.Add(seriesQH);
//Behavior
ChartCrossHairBehavior crossHairQH = new ChartCrossHairBehavior()
{
HorizontalAxisLabelAlignment = ChartAlignment.Center,
VerticalAxisLabelAlignment = ChartAlignment.Center
};
ChartZoomPanBehavior zoomPanBehaviorQH = new ChartZoomPanBehavior()
{
EnableZoomingToolBar = true,
HorizontalPosition = HorizontalAlignment.Right,
VerticalPosition = VerticalAlignment.Top,
ToolBarBackground = new SolidColorBrush(Colors.Transparent),
EnableMouseWheelZooming = true,
EnablePanning = true,
EnableSelectionZooming = true,
ZoomRelativeToCursor = true,
ResetOnDoubleTap = true,
MaximumZoomLevel = 10,
EnablePinchZooming = true
};
chrtKennlinie.Behaviors.Add(crossHairQH);
chrtKennlinie.Behaviors.Add(zoomPanBehaviorQH);
}
I hope you understand my problem now a little bit better :-)
Thank you very much for your help!