Alignment of ASP.NET Chart -
I use classic asp net charting to present some data and put it in pdf. A problem that I can not solve, when I add legends to the right hand of the graph, then it is pushed. Can anyone see why?
_chart. High = _chartHeight; _chart.Width = _chartWidth; Legend Legend = New Legend ("Default"); Legend Legend style = legendstyle Column; Legend ITETATufit = False; Story Docking = docking Right; Story Align = system Drawing String alignment _chart.Legends.Add (narrative); Chain series = new series ("default"); _chart.Series.Add (series); Chartere chart Aria = new chartaray ("ChartAria 1"); //chartArea.Position.Y = 0; _chart.ChartAreas.Add (chartArea); // - This data will usually be collected from _travelRepository.TravelModesForTheYear // - but for speed I have hardcoded like this for everyone in the country. Series ["default"]. Points. Datawind (xValues, yValues); System.Drawing.Color [] Color = New System. Drawing Color [] {_orange, _yellow, _pink, _red, _green, _purple}; Int i = 0; Forch (System web.image data validation charting.datpoint point in_chart series [["default"] points) {_chart.Series ["default"]. Issue [I] Color = color [ii]; If (showLegends) _chart.Series ["default"]. Point [i]. Label = "#PERCENT"; I ++; } _chart.Series ["default"] Chart Type = SeriesChartType.Pie; _chart.Series ["default"] ["pilebel style"] = showgreens? "Inside": "disabled"; _chart.Series ["default"]. LabelForeColor = System.Drawing.Color.White; _chart.ChartAreas ["ChartArea1"]. Area3DStyle.Enable3D = false; _chart.ChartAreas ["ChartArea1"]. Alignment style = area alignment style. Event; _chart.BorderlineWidth = 0; _chart.ChartAreas ["ChartArea1"]. Axis.Label style. Enabled = showLegends; _chart.ChartAreas ["ChartArea1"]. AxisX.LabelStyle.Enabled = showLegends; _chart.ChartAreas ["ChartArea1"]. Alignment Orientation = AreaAlignition Orientation. HOGSTAL; _chart.Legends [0] .Enabled = showLegends;
You can set the status and IsDockedInsideChartArea of the legend. Also charters can be given space, so it does not grow around. You have to play a little bit with the values to fix this.
legend.Position.X = 0 Legend.Pos. Y = 0 Legend Blocked inside Chartere = false field. composition. Heights = 94 area. Creation = method = 98 area composition. Y = 0 area. Composition.x = 0
Comments
Post a Comment