How to change legend symbol on web map?

I am using Carlos Aguilera WebChart and would like to change the legend labels according to the line markers that I use on the line. I have the following diagram:

image generated from webchart

Here is my code for the legend:

objLegend = New WebChart.ChartLegend objLegend.Font = New Font("Verdana", 8) objLegend.Width = 150 objLegend.Position = LegendPosition.Right objLegend.Background.Color = Color.LightYellow objLegend.Background.Type = InteriorType.Solid objLegend.Background.WrapMode = Drawing2D.WrapMode.Tile objEngine.Legend = objLegend 

And the code for setting line markers

  Select Case intColorIndex Mod 5 Case 0 objLineChart.LineMarker = New CircleLineMarker(6, Color.Red, Color.Black) Case 1 objLineChart.LineMarker = New DiamondLineMarker(6, Color.Red, Color.Black) Case 2 objLineChart.LineMarker = New SquareLineMarker(6, Color.Red, Color.Black) Case 3 objLineChart.LineMarker = New TriangleLineMarker(6, Color.Red, Color.Black) Case 4 objLineChart.LineMarker = New XLineMarker(6, Color.Red, Color.Black) End Select 

None of these places seem to have a property for setting the type of the Legend marker, and ChartEngine is no possibility in the ChartEngine object either.

The legend text is set in the line, but the only available property from LineChart is the text, there is no option for the symbol.

Can I change the legend marker with this control? If so, how to do it?

+4
source share
1 answer

In http://www.carlosag.net/tools/webchart/sample-pie-chart legend symbols look like they are set in the markup:

 <web:chartcontrol> ... <legend width="110" font="Tahoma, 6.75pt"> <border endcap="Flat" dashstyle="Solid" startcap="Flat" color="Black" width="1" linejoin="Miter"></border> <background type="Solid" startpoint="0, 0" forecolor="Black" endpoint="0, 100" color="White" hatchstyle="Horizontal"></background> </legend> </web:chartcontrol> 

You can try to set legend symbols by controlling the <legend> element inside <web:chartcontrol> .

+2
source

Source: https://habr.com/ru/post/1446085/


All Articles