amankazi Posted August 12, 2008 Report Share Posted August 12, 2008 When user right clicks on the Y-Axis. How can I get the Y-Axis belongs to which curve ?index? Quote Link to comment Share on other sites More sharing options...
Frank Posted August 12, 2008 Report Share Posted August 12, 2008 Multiple series can be assigned to one give Y-Axis. You need to go through the Series collection and compare series.AxisY to the Y-Axis being clicked. Quote Link to comment Share on other sites More sharing options...
amankazi Posted August 13, 2008 Author Report Share Posted August 13, 2008 Can you please explain the working of Y axis in my scenario with the series? I am comparing it. How will I get the Index of the series to which the Y axis belongs to ? Here is the code snippet for it AxisY temp_Y = (AxisY)e.Object;string SeriesName ; for(IntYAxisCount = 0; IntYAxisCount < chartHistoricGraph.AxesY.Count;IntYAxisCount++){ if(temp_Y.Equals(chartHistoricGraph.AxesY[intYAxisCount])) { SeriesName = chartHistoricGraph.Series[intYAxisCount].Text; break; }} Quote Link to comment Share on other sites More sharing options...
amankazi Posted September 1, 2008 Author Report Share Posted September 1, 2008 Following is the code how I got the exact Y axis on which user has clicked. int IntSeriesIndex = 0; AxisY YAxisObject = (AxisY)e.Object;for (int IntYAxisCount = 0; IntYAxisCount < chartHistoricGraph.AxesY.Count; IntYAxisCount++) { if (YAxisObject.Equals(chartHistoricGraph.AxesY[intYAxisCount])) { string LegendName = chartHistoricGraph.AxesY[intYAxisCount].Title.ToString();for (int IntSeriesCount = 0; IntSeriesCount < chartHistoricGraph.Series.Count; IntSeriesCount++) { if (chartHistoricGraph.Series[intSeriesCount].Text == LegendName.ToString()) { IntSeriesIndex = IntSeriesCount; } } break; } } I am facing one more issue, on change of the color of series, the dynamically added Yaxis color is not changing. Quote Link to comment Share on other sites More sharing options...
Frank Posted September 2, 2008 Report Share Posted September 2, 2008 If you mean the Y-Axis labels text color, you can change it by doing: axis.TextColor = color; Quote Link to comment Share on other sites More sharing options...
amankazi Posted September 3, 2008 Author Report Share Posted September 3, 2008 User can change the color of the series by picking it from color pallet(User can right click on the series and change the color). To do this I am using the CommandID "29468", when user changes the color at runtime the color the Y axis should also change. But it is not changing, as I am using the predefined CommandID, I am not sure how I can change the color of the Y-axis at runtime. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.