Home 소개       다운로드       온라인 설명서      주식차트    Q & A     Blog    

Mixed chart - line, column, linearea







혼합형, 듀얼 시리즈리스트 차트




Mixed chart - line, column, linearea  Mixed chart - Pie, Linearea  Mixed chart - column, pylamid, gauge  혼합형 차트 - 주식차트, 막대, 라인  라인, 막대 일반 혼합형 차트  [히포차트 4.2] 게이지차트를 시리즈 레벨에서 그려보자  [히포차트 4.2] 일반게이지와 라인 차트의 혼합형 샘플  


C#
 
SeriesList sList = new SeriesList();
sList.ChartType = ChartType.Line;

sList.AxisFactor.YAxis.TitleLabel.Text = "y axis title";
sList.AxisFactor.XAxis.TitleLabel.Text = "x axis title";

sList.AxisFactor.XAxis.Interval = 2;

Random r = new Random();
for(int i = 0; i < 2; i++)
{
Series sr = new Series();
sr.AreaType = AreaType.LineArea;
sr.Name = "Serie" + i.ToString();

for(int x = 0; x < 20; x++)
{
SeriesItem item = new SeriesItem();
item.Name = x.ToString();
item.YValue = -25 + r.Next(50);

if (i == 1) item.YValue = r.Next(30);

sr.items.Add(item);
}
sList.SeriesCollection.Add(sr);
}

SeriesList sList2 = new SeriesList();
sList2.ChartType = ChartType.Column;
sList2.AxisFactor.YAxis.FigureFormat = FigureFormat.Currency;
sList2.AxisFactor.YAxis.Decimalpoint = 0;
sList2.AxisFactor.YAxis.CultureInfo.Name = "en-US";

sList2.AxisFactor.YAxis.SetAxisStep(0, 30000, 10000);

sList2.AxisFactor.AxisItems.Add(new Axis(AxisType.Ytype));

for(int i = 0; i < 2; i++)
{
Series sr = new Series();
if (i == 0) sr.SeriesColor = Color.YellowGreen;
sr.Name = "Serie" + i.ToString();

if (i == 1)
{
sr.AxisIndex = 1;
sr.ChartType = ChartType.Line;
sr.SeriesColor = Color.Red;
sr.Points.Width = 0;
}

for(int x = 0; x < 70; x++)
{
SeriesItem item = new SeriesItem();
item.Name = x.ToString();
item.YValue = r.Next(9000);

if (i == 1) item.YValue = r.Next(30, 50);

sr.items.Add(item);
}
sList2.SeriesCollection.Add(sr);
}

this.hHippoChart1.Direction = GraphAreaLocation.Vertical;

sList.AxisFactor.YAxis.AxisMagin = 30;
sList2.AxisFactor.YAxis.AxisMagin = 30;

this.hHippoChart1.SeriesListDictionary.Add(sList2);
this.hHippoChart1.SeriesListDictionary.Add(sList);
this.hHippoChart1.DrawChart();


VB
 
Dim sList As New. SeriesList()
sList.ChartType = ChartType.Line

sList.AxisFactor.YAxis.TitleLabel.Text = "y axis title"
sList.AxisFactor.XAxis.TitleLabel.Text = "x axis title"

sList.AxisFactor.XAxis.Interval = 2

Dim r As New. Random()
For i As Integer = 0 To 1
Dim sr As New. Series()
sr.AreaType = AreaType.LineArea
sr.Name = "Serie" & i.ToString()

For x As Integer = 0 To 19
Dim item As New. SeriesItem()
item.Name = x.ToString()
item.YValue = -25 + r.[Next](50)

If i = 1 Then
item.YValue = r.[Next](30)
End If

sr.items.Add(item)
Next
sList.SeriesCollection.Add(sr)
Next

Dim sList2 As New. SeriesList()
sList2.ChartType = ChartType.Column
sList2.AxisFactor.YAxis.FigureFormat = FigureFormat.Currency
sList2.AxisFactor.YAxis.Decimalpoint = 0
sList2.AxisFactor.YAxis.CultureInfo.Name = "en-US"

sList2.AxisFactor.YAxis.SetAxisStep(0, 30000, 10000)

sList2.AxisFactor.AxisItems.Add(New Axis(AxisType.Ytype))

For i As Integer = 0 To 1
Dim sr As New. Series()
If i = 0 Then
sr.SeriesColor = Color.YellowGreen
End If
sr.Name = "Serie" & i.ToString()

If i = 1 Then
sr.AxisIndex = 1
sr.ChartType = ChartType.Line
sr.SeriesColor = Color.Red
sr.Points.Width = 0
End If

For x As Integer = 0 To 69
Dim item As New. SeriesItem()
item.Name = x.ToString()
item.YValue = r.[Next](9000)

If i = 1 Then
item.YValue = r.[Next](30, 50)
End If

sr.items.Add(item)
Next
sList2.SeriesCollection.Add(sr)
Next

Me.hHippoChart1.Direction = GraphAreaLocation.Vertical

sList.AxisFactor.YAxis.AxisMagin = 30
sList2.AxisFactor.YAxis.AxisMagin = 30

Me.hHippoChart1.SeriesListDictionary.Add(sList2)
Me.hHippoChart1.SeriesListDictionary.Add(sList)
Me.hHippoChart1.DrawChart()



※ 히포차트 샘플 코드는 버전별로 상이한 결과를 나타낼 수 있습니다.

이 코드 관련 문의 사항은 페이스북 리플을 달아주시거나 아래 이메일로 이 페이지 주소와 함께 문의주세요.

helpdesk@hippochart.com





Copyright © 2009-2016, HippoChart. Inc.  All Rights Reserved.