Hi all,
I developed a Function that creates a Chart Area inside a chart.
I tried to assign to each Chart Area a legend without success.
A part of this Function is:
This function is called in this way:
Lista_KPI is a list of string of 2 elements: CSSR and DCR
NomeContatore is a string and it is equal at first step to value "CSSR" and in second Step to "DCR"
Titolo is a string and it is equal at first step to value "CSSR" and in second Step to "DCR".
Titolo is equal to NomeContatore
Each Element of list calls the function above.
Issue s that both legend and also Title are showed always in first Chart Area
Image may be NSFW.
Clik here to view.
Any suggestion?
Thank in advanced
gio
I developed a Function that creates a Chart Area inside a chart.
I tried to assign to each Chart Area a legend without success.
A part of this Function is:
Code:
Private Sub _CreateStackedDrawKPI(ByVal MyChart As Chart, ByVal T As DataTable, ByVal titolo As String, ByVal NumChartArea As Integer, ByVal legenda As String)
x = (From p In T.AsEnumerable()
Select p.Field(Of String)("Week") Distinct).ToArray()
' Order By p.Field(Of String)("Week")
y1K = (From p In T.AsEnumerable()
Select p.Field(Of Integer)("Num_CS_RAB_Est_Att")).ToArray()
y2K = (From p In T.AsEnumerable()
Select p.Field(Of Integer)("Num_CS_RAB_Est_Succ")).ToArray()
y3 = (From p In T.AsEnumerable()
Select p.Field(Of Double)("CSSR")).ToArray()
Dim ChartArea1 = New ChartArea()
ChartArea1.Name = titolo
MyChart.ChartAreas.Add(titolo)
Dim Mylegend As New Legend
Mylegend.Name = legenda
MyChart.Legends.Add(legenda)
MyChart.Legends(legenda).DockedToChartArea = titolo
MyChart.Legends(titolo).IsDockedInsideChartArea = False
...
Code:
Dim aa As New MyFunctions
....
If Lista_KPI.Count = 1 Then
ChartKPI = New Chart
ChartKPI.Name = "Chart_KPI"
SplitContainer3.Panel2.Controls.Add(ChartKPI)
aa.CreateStackedDrawKPI(ChartKPI, T_Data1, NomeContatore, Lista_KPI.Count, Titolo)
End If
If Lista_KPI.Count = 2 Then
aa.CreateStackedDrawKPI(ChartKPI, T_Data1, NomeContatore, Lista_KPI.Count, Titolo)
End If
NomeContatore is a string and it is equal at first step to value "CSSR" and in second Step to "DCR"
Titolo is a string and it is equal at first step to value "CSSR" and in second Step to "DCR".
Titolo is equal to NomeContatore
Each Element of list calls the function above.
Issue s that both legend and also Title are showed always in first Chart Area
Image may be NSFW.
Clik here to view.

Any suggestion?
Thank in advanced
gio