Chart - две черных линии нарисовать
#40139624
Ссылка:
Ссылка на сообщение:
Ссылка с названием темы:
Ссылка на профиль пользователя:
Ссылка на вложение:
|
|
|
По советам чатЖпт удалось разорвать вторую линию только на легенде.
В сериях 20000 точек. 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 24. 25. 26. 27. 28. 29. 30. 31. 32. 33. 34. 35. 36. 37. 38. 39. 40. 41. 42. 43. 44. 45. 46. 47.
public Form1(StreamReader sr1, StreamReader sr2
, int c1, int c2, bool vFlag) {
//создаем элемент Chart
Chart myChart = new Chart();
//кладем его на форму и растягиваем на все окно.
Controls.Add(myChart); // 1 способ добавить упр.элемент на форму
// myChart.Parent = this; /// 2 способ добавить чарт на форму
myChart.Dock = DockStyle.Fill;
//добавляем в Chart область для рисования графиков, их может быть
//много, поэтому даем ей имя.
myChart.ChartAreas.Add(new ChartArea("Length of meridian arc functions"));
//Создаем и настраиваем набор точек для рисования графика, в том
//не забыв указать имя области, на которой хотим отобразить этот
//набор точек.
Series mySeriesOfPoint1 = new Series("Deviation 1");
mySeriesOfPoint1.ChartType = SeriesChartType.Line;
mySeriesOfPoint1.ChartArea = "Length of meridian arc functions";
// mySeriesOfPoint1.BorderDashStyle = ChartDashStyle.Dash;
mySeriesOfPoint1.Color = Color.Black;
getFile (mySeriesOfPoint1, sr1 , c1, c2, true, vFlag);
myChart.Series.Add(mySeriesOfPoint1);
Series mySeriesOfPoint2 = new Series("Deviation 2");
mySeriesOfPoint2.ChartType = SeriesChartType.Line;
mySeriesOfPoint2.ChartArea = "Length of meridian arc functions";
// mySeriesOfPoint2.BorderDashStyle = ChartDashStyle.DashDotDot;
mySeriesOfPoint2.Color = Color.Black;
// mySeriesOfPoint2.MarkerStyle = MarkerStyle.Cross; // Устанавливаем крестики
// mySeriesOfPoint2.MarkerSize = 10; // Размер маркеров
getFile (mySeriesOfPoint2, sr2 , c1, c2, false, vFlag);
myChart.Series.Add(mySeriesOfPoint2);
myChart.Legends.Add(new Legend("customLegend"));
myChart.Legends[0].Enabled = true;
myChart.Legends[0].Docking = Docking.Bottom;
myChart.Series[0].LegendText="book coefs";
// myChart.Series[0].IsVisibleInLegend = true;
myChart.Series[1].LegendText="calculated coefs";
// myChart.Series[1].IsVisibleInLegend = true;
myChart.Invalidate();
}
удалось крестиками извернуться, но крестик на легенде рисовал руками.
|
|