package Custom;
import ChartDirector.*;
import java.util.Date;
///////////////////////////////////////////////////////////////////////////////////////////////////
// Copyright 2008 Advanced Software Engineering Limited
//
// ChartDirector FinanceChart class library
// - Requires ChartDirector Ver 5.0 or above
//
// You may use and modify the code in this file in your application, provided the code and
// its modifications are used only in conjunction with ChartDirector. Usage of this software
// is subjected to the terms and condition of the ChartDirector license.
///////////////////////////////////////////////////////////////////////////////////////////////////
/// <summary>
/// Represents a Financial Chart
/// </summary>
public class FinanceChart extends MultiChart
{
int m_totalWidth = 0;
int m_totalHeight = 0;
boolean m_antiAlias = true;
boolean m_logScale = false;
boolean m_axisOnRight = true;
int m_leftMargin = 40;
int m_rightMargin = 40;
int m_topMargin = 30;
int m_bottomMargin = 30;
int m_plotAreaBgColor = 0xffffff;
int m_plotAreaBorder = 0x888888;
int m_plotAreaGap = 2;
int m_majorHGridColor = 0xdddddd;
int m_minorHGridColor = 0xdddddd;
int m_majorVGridColor = 0xdddddd;
int m_minorVGridColor = 0xdddddd;
String m_legendFont = "normal";
double m_legendFontSize = 8;
int m_legendFontColor = Chart.TextColor;
int m_legendBgColor = 0x80cccccc;
String m_yAxisFont = "normal";
double m_yAxisFontSize = 8;
int m_yAxisFontColor = Chart.TextColor;
int m_yAxisMargin = 14;
String m_xAxisFont = "normal";
double m_xAxisFontSize = 8;
int m_xAxisFontColor = Chart.TextColor;
double m_xAxisFontAngle = 0;
double[] m_timeStamps = null;
double[] m_highData = null;
double[] m_lowData = null;
double[] m_openData = null;
double[] m_closeData = null;
double[] m_volData = null;
String m_volUnit = "";
int m_extraPoints = 0;
String m_yearFormat = "{value|yyyy}";
String m_firstMonthFormat = "<*font=bold*>{value|mmm yy}";
String m_otherMonthFormat = "{value|mmm}";
String m_firstDayFormat = "<*font=bold*>{value|d mmm}";
String m_otherDayFormat = "{value|d}";
String m_firstHourFormat = "<*font=bold*>{value|d mmm\nh:nna}";
String m_otherHourFormat = "{value|h:nna}";
int m_timeLabelSpacing = 50;
String m_generalFormat = "P3";
String m_toolTipMonthFormat = "[{xLabel|mmm yyyy}]";
String m_toolTipDayFormat = "[{xLabel|mmm d, yyyy}]";
String m_toolTipHourFormat = "[{xLabel|mmm d, yyyy hh:nn:ss}]";
XYChart m_mainChart = null;
XYChart m_currentChart = null;
/// <summary>
/// Create a FinanceChart with a given width. The height will be automatically determined
/// as the chart is built.
/// </summary>
/// <param name="width">Width of the chart in pixels</param>
public FinanceChart(int width)
{
super(width, 1);
m_totalWidth = width;
}
/// <summary>
/// Enable/Disable anti-alias. Enabling anti-alias makes the line smoother. Disabling
/// anti-alias make the chart file size smaller, and so can be downloaded faster
/// through the Internet. The default is to enable anti-alias.
/// </summary>
/// <param name="antiAlias">True to enable anti-alias. False to disable anti-alias.</param>
public void enableAntiAlias(boolean antiAlias)
{
m_antiAlias = antiAlias;
}
/// <summary>
/// Set the margins around the plot area.
/// </summary>
/// <param name="m_leftMargin">The distance between the plot area and the chart left edge.</param>
/// <param name="m_topMargin">The distance between the plot area and the chart top edge.</param>
/// <param name="m_rightMargin">The distance between the plot area and the chart right edge.</param>
/// <param name="m_bottomMargin">The distance between the plot area and the chart bottom edge.</param>
public void setMargins(int leftMargin, int topMargin, int rightMargin, int bottomMargin)
{
m_leftMargin = leftMargin;
m_rightMargin = rightMargin;
m_topMargin = topMargin;
m_bottomMargin = bottomMargin;
}
/// <summary>
/// Add a text title above the plot area. You may add multiple title above the plot area by
/// calling this method multiple times.
/// </summary>
/// <param name="alignment">The alignment with respect to the region that is on top of the
/// plot area.</param>
/// <param name="text">The text to add.</param>
/// <returns>The TextBox object representing the text box above the plot area.</returns>
public TextBox addPlotAreaTitle(int alignment, String text)
{
TextBox ret = addText(m_leftMargin, 0, text, "bold", 10, Chart.TextColor, alignment);
ret.setSize(m_totalWidth - m_leftMargin - m_rightMargin + 1, m_topMargin - 1);
ret.setMargin(0);
return ret;
}
/// <summary>
/// Set the plot area style. The default is to use pale yellow 0xfffff0 as the background,
/// and light grey 0xdddddd as the grid lines.
/// </summary>
/// <param name="bgColor">The plot area background color.</param>
/// <param name="majorHGridColor">Major horizontal grid color.</param>
/// <param name="majorVGridColor">Major vertical grid color.</param>
/// <param name="minorHGridColor">Minor horizontal grid color. In current version, minor
/// horizontal grid is not used.</param>
/// <param name="minorVGridColor">Minor vertical grid color.</param>
public void setPlotAreaStyle(int bgColor, int majorHGridColor, int majorVGridColor,
int minorHGridColor, int minorVGridColor)
{
m_plotAreaBgColor = bgColor;
m_majorHGridColor = majorHGridColor;
m_majorVGridColor = majorVGridColor;
m_minorHGridColor = minorHGridColor;
m_minorVGridColor = minorVGridColor;
}
/// <summary>
/// Set the plot area border style. The default is grey color (888888), with a gap
/// of 2 pixels between charts.
/// </summary>
/// <param name="borderColor">The color of the border.</param>
/// <param name="borderGap">The gap between two charts.</param>
public void setPlotAreaBorder(int borderColor, int borderGap)
{
m_plotAreaBorder = borderColor;
m_plotAreaGap = borderGap;
}
/// <summary>
/// Set legend style. The default is Arial 8 pt black color, with light grey background.
/// </summary>
/// <param name="font">The font of the legend text.</param>
/// <param name="fontSize">The font size of the legend text in points.</param>
/// <param name="fontColor">The color of the legend text.</param>
/// <param name="bgColor">The background color of the legend box.</param>
public void setLegendStyle(String font, double fontSize, int fontColor, int bgColor)
{
m_legendFont = font;
m_legendFontSize = fontSize;
m_legendFontColor = fontColor;
m_legendBgColor = bgColor;
}
/// <summary>
/// Set x-axis label style. The default is Arial 8 pt black color no rotation.
/// </summary>
/// <param name="font">The font of the axis labels.</param>
/// <param name="fontSize">The font size of the axis labels in points.</param>
/// <param name="fontColor">The color of the axis labels.</param>
/// <param name="fontAngle">The rotation of the axis labels.</param>
public void setXAxisStyle(String font, double fontSize, int fontColor, double fontAngle)
{
m_xAxisFont = font;
m_xAxisFontSize = fontSize;
m_xAxisFontColor = fontColor;
m_xAxisFontAngle = fontAngle;
}
/// <summary>
/// Set y-axis label style. The default is A
没有合适的资源?快使用搜索试试~ 我知道了~
Teechart_for_java_chm
共2242个文件
htm:1455个
png:328个
jsp:190个
需积分: 3 10 下载量 158 浏览量
2011-03-03
17:11:30
上传
评论
收藏 15.46MB ZIP 举报
温馨提示
Teechart_for_java_chm
资源详情
资源评论
资源推荐
收起资源包目录
Teechart_for_java_chm (2242个子文件)
javachartdir.chm 5.54MB
maxchartapi.css 2KB
maxcharthtml.css 460B
maxchartindex.css 212B
nozoom.cur 326B
zoomin.cur 326B
zoomout.cur 326B
tile.gif 5KB
tile.gif 5KB
wait.gif 2KB
zoomin.gif 941B
zoomInIcon.gif 941B
zoomout.gif 936B
zoomOutIcon.gif 936B
rightarrow.gif 900B
leftarrow.gif 900B
xyrange.gif 890B
xyrange.gif 890B
xrange.gif 871B
xrange.gif 871B
pause.gif 867B
upleftpb.gif 866B
downrightpb.gif 864B
downpb.gif 863B
downleftpb.gif 862B
rightpb.gif 862B
leftpb.gif 862B
uprightpb.gif 862B
pointer.gif 861B
pointer.gif 861B
play.gif 860B
dot.gif 860B
uppb.gif 859B
spindown.gif 835B
spinup.gif 834B
minus.gif 216B
plus.gif 204B
doc.gif 194B
source.gif 174B
downarrow.gif 154B
uparrow.gif 147B
barrow.gif 132B
gas.gif 115B
gas.gif 115B
arrow.gif 106B
rga.gif 106B
lfa.gif 105B
dna.gif 103B
upa.gif 102B
spacer.gif 43B
indexleft.htm 202KB
indexindex.htm 178KB
financedemo.htm 94KB
zoomscrolldemo.htm 44KB
zoomscrolldemoweb.htm 43KB
Chart.htm 35KB
indexleft.htm 33KB
zoomscrolldemo2.htm 32KB
FinanceChart.htm 29KB
paramsub.htm 25KB
zoomscrolldemo2web.htm 25KB
realtimedemo.htm 22KB
zoomscrollintroweb.htm 22KB
datatable2.htm 18KB
XYChart.htm 17KB
dualhbar.htm 16KB
multisymbolline.htm 16KB
colorgantt.htm 16KB
binaryseries.htm 15KB
layergantt.htm 15KB
datatable.htm 15KB
simpleclickable.htm 15KB
unevenpoints.htm 14KB
multiaxes.htm 14KB
SurfaceChart.htm 14KB
enhancedarea.htm 14KB
JsChartViewer.htm 14KB
xzonecolor.htm 13KB
percentarea.htm 13KB
percentbar.htm 13KB
DrawArea.htm 13KB
AngularMeter.htm 13KB
missingpoints.htm 13KB
linefill.htm 13KB
PyramidChart.htm 13KB
LinearMeter.htm 13KB
PieChart.htm 13KB
PolarChart.htm 13KB
markbar.htm 12KB
linecompare.htm 12KB
legendpie2.htm 12KB
BaseMeter.htm 12KB
multistackbar.htm 12KB
colorspec.htm 12KB
ChartViewer.htm 12KB
gantt.htm 12KB
classlib.htm 12KB
dbclickable.htm 12KB
cdml.htm 12KB
WebChartViewer.htm 11KB
共 2242 条
- 1
- 2
- 3
- 4
- 5
- 6
- 23
hgyin212314
- 粉丝: 72
- 资源: 82
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0