y 축 레이블을 설정할 수 없지만 (가능하지는 않다고 생각합니다.) Title 속성을 사용하여 범례에 설정할 수 있습니다. x 축에서 그것은 DataPointSeries'IndependentValueBinding의 바인딩 세트에 따라 다릅니다.
이 샘플에서는 모든 레코드/데이터 포인트를 나타내는 클래스 개체를 만들었습니다.
List<ChartInfo> list = new List<ChartInfo>();
ChartInfo item = new ChartInfo();
item.Label = "Individual";
item.Vale = 27;
list.Add(item);
item = new ChartInfo();
item.Label = "Corporate";
item.Vale = 108;
list.Add(item);
DataPointSeries series = new ColumnSeries();
series.Title = "Quantity";
series.DependentValueBinding = new Binding("Value");
series.IndependentValueBinding = new Binding("Label");
series.ItemsSource = list;
series.SelectionChanged += new SelectionChangedEventHandler(series_SelectionChanged);
this.chartingToolkitControl.Series.Add(series);
그것은 나에게이 결과를 줄 것이다 :
public class ChartInfo
{
public string Label { get; set; }
public double Value { get; set; }
}
그런 다음이 코드가 있습니다. 줌에 대한
alt text http://www.freeimagehosting.net/uploads/78e2598620.jpg
- 내가 올바른 용어는 드릴 다운 생각합니다. SelectionChanged 이벤트를 사용할 수 있습니다 (위의 코드 참조). 당신이해야 할 일은 당신의 데이터 소스를 다시 쿼리하고 그래프의 시리즈를 지우고 당신의 질의 결과에 기초하여 새로운 것을 추가하는 것입니다.
private void series_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
//The sender here is of type DataPointSeries wherein you could get the SelectedItem (in our case ChartInfo) and from there you could do the requery.
}
답변 해 주셔서 감사합니다. 정말 도움이됩니다. 그런 식으로 줌을 생각하지 않았습니다. 감사. – Clerks
@ Clerks - 대답이 도움이된다면 투표를 잊어 버리고 질문의 대답으로 표시해야합니다. :) –