📄 presales_questions.html
字号:
<p><font color=darkred>
<b>19. Can I save the charts as gif or jpeg images?</b>
</font>
<p>
EasyCharts comes with a JpegEncoder that you can use for saving the charts
as jpeg images.
<p>
The following example shows you have to use the JpegEncoder
to generate jpeg images from the charts.
<a href="examples/java/SaveJpegChart.java">SaveJpegChart.java</a>.
<p>
You can also use other image encoders (such as the
<a href="http://www.acme.com/java/software/Acme.JPM.Encoders.GifEncoder.html">Acme GifEncoder</a>)
to generate charts with other image formats.<br>
<a href="examples/java/SaveGifChart.java">SaveGifChart.java</a>.
<p><br>
<a name="combination"></a>
<p><font color=darkred>
<b>20. Does EasyCharts support combination or overlay charts?</b>
</font>
<p>
Yes. EasyCharts 2.5 or later can combine charts and chart types by laying
one chart on top of the other.
<p>
<a href="examples/overlay_simple.html">simple overlay examples</a><br>
<a href="examples/overlay_double.html">overlay with double range axis</a><br>
<a href="examples/overlay_complex.html">complex overlay example</a>
<p><br>
<a name="multiple_axis"></a>
<p><font color=darkred>
<b>21. Does EasyCharts support multiple y-axis?</b>
</font>
<p>
Yes. EasyCharts version 2.5 or later supports double y-axis.
<p>
<a href="examples/bar_range_double.html">bar chart with double y-axis</a>
<p><br>
<a name="data_binding"></a>
<p><font color=darkred>
<b>22. Does EasyCharts support data binding?</b>
</font>
<p>
No. Data has to be passed into the charts using the applet parameters or the
java API. To retrieve data from a database, the data has to be read by a
script on the server side, and a web page with the applet tag containing the
data has to be dynamically built and then served to the client's web browser.
<p><br>
<a name="loading_data"></a>
<p><font color=darkred>
<b>23. How do I load data into the charts?</b>
</font>
<p>
For an applet use the sampleValues_N parameter:
<p>
<applet code=com.objectplanet.chart.BarChartApplet<BR>
archive=chart.jar width=300 height=200><BR>
<param name=sampleValues_0 value="1,2,3,4,5"><BR>
</applet>
<p>
In a java application, use the API methods:
<p>
BarChart chart = new BarChart();<BR>
double[] values = new double[] {1,2,3,4,5};<BR>
chart.setSampleCount(values.length);<BR>
chart.setSampleValues(0, values);
<p><br>
<a name="printing"></a>
<p><font color=darkred>
<b>24. Can the charts be printed?</b>
</font>
<p>
Yes. For an applet, use the browsers printing command. However there are a
few problems: 1) In Netscape the applets are printed larger than they appear
on the screen. 2) In Internet Explorer 4.0 or older, if you change the chart
applet's data using JavaScript during runtime, the changed data will not
print, only the original applet from the web page (IE reads the page again
before printing). 3) Internet Explorer 5 or later on Windows 2000 does
not print applets very well (often only black thin lines, no colors).
Use the
<a href="doc/barchart.html#printAsBitmap">
printAsBitmap</a> parameter to work around this problem.
<p>
To print the charts correctly in a web page, they should be generated as
images on the server side. You can use the ChartServlet that comes
with EasyCharts 2.5 or later to do this.
<p>
To print in a java application, use the printing capabilities of the
standard Java API. Here is an example;
<a href="examples/java/PrintChart.java">PrintChart.java</a>
<p><br>
<a name="pattern_filling"></a>
<p><font color=darkred>
<b>25. Does EasyCharts support pattern filling for black and white printouts?</b>
</font>
<p>
No. Due to the charts being based on JDK 1.02 and JDK 1.1 they do not support
pattern filling or line styles.
<p><br>
<a name="multiline"></a>
<p><font color=darkred>
<b>26. Does EasyCharts support multiline labels?</b>
</font>
<p>
Yes, use \n in the labels where you want a line break.
<p>
<param name=chartTitle value="This is\nthe title"><br>
or<br>
chart.setTitle("This is\nthe title");
<p>
<a href="examples/bar_chartlabels.html">multiline chart title</a>
<p><br>
<a name="angled"></a>
<p><font color=darkred>
<b>27. Does EasyCharts support angled labels?</b>
</font>
<p>
Yes.
<p>
<a href="examples/bar_chartlabels.html#vertical">angled bar labels</a><br>
<a href="examples/bar_chartlabels.html#axislabels">angled axis labels</a><br>
<a href="examples/bar_value.html#angle">angled bar value labels</a><br>
<a href="examples/line_value.html#angle">angled line value labels</a>
<p><br>
<a name="multiple_series"></a>
<p><font color=darkred>
<b>28. Does EasyCharts support multiple data series?</b>
</font>
<p>
Yes. With an applet, use the seriesCount parameter:
<p>
<applet code=com.objectplanet.chart.BarChartApplet<BR>
archive=chart.jar width=300 height=200><BR>
<param name=seriesCount value=3><BR>
<param name=sampleValues_0 value="1,2,3,4,5"><br>
<param name=sampleValues_1 value="3,4,5,6,7"><br>
<param name=sampleValues_2 value="5,6,7,8,9"><br>
</applet>
<p>
In a java application, do the following:
<p>
BarChart chart = new BarChart();<BR>
chart.setSampleCount(5);<BR>
chart.setSeriesCount(3);<BR>
double[] values0 = new double[] {1,2,3,4,5};<BR>
double[] values1 = new double[] {3,4,5,6,7};<BR>
double[] values2 = new double[] {5,6,7,8,9};<BR>
chart.setSampleValues(0, values0);<BR>
chart.setSampleValues(1, values1);<BR>
chart.setSampleValues(2, values2);
<p>
<a href="examples/bar_multiple_series.html">bar chart with multiple series</a><br>
<a href="examples/line_multiple_series.html">line chart with multiple series</a><br>
<a href="examples/pie_multiple_series.html">pie chart with multiple series</a>
<p><br>
<a name="stacked"></a>
<p><font color=darkred>
<b>29. Can I make stacked bar charts or stacked line charts/area charts?</b>
</font>
<p>
Yes. For a bar chart applet, do the following.
<p>
<applet code=com.objectplanet.chart.BarChartApplet<BR>
archive=chart.jar width=300 height=200><BR>
<param name=seriesCount value=3><br>
<param name=sampleValues_0 value="1,2,3,4,5"><br>
<param name=sampleValues_1 value="3,4,5,6,7"><br>
<param name=sampleValues_2 value="5,6,7,8,9"><br>
<param name=barType value=stacked><BR>
</applet>
<P>
In java, do the following:
<p>
chart.setBarType(BarChart.STACKED_BARS);
<p>
<a href="examples/bar_stacked.html">stacked bars</a>
<p>
For a line chart applet, do the following.
<p>
<applet code=com.objectplanet.chart.LineChartApplet<BR>
archive=chart.jar width=300 height=200><BR>
<param name=seriesCount value=3><br>
<param name=sampleValues_0 value="1,2,3,4,5"><br>
<param name=sampleValues_1 value="3,4,5,6,7"><br>
<param name=sampleValues_2 value="5,6,7,8,9"><br>
<param name=stackedOn value=true><BR>
</applet>
<p>
In java, do the following:
<p>
chart.setStackedOn(true);
<p>
<a href="examples/line_stacked.html">stacked lines</a>
<p><br>
<a name="drilldown"></a>
<p><font color=darkred>
<b>30. Can I make drilldown charts?</b>
</font>
<p>
Yes. You can associate a URL with every sample or series in the chart applets
by using the url_N_M and urltarget_N_M parameters. The url can then be pointed
to another chart containing the drill down data.
See <a href="doc/applet_bar.html#url_and_drilldown">here</a> for details.
<p><br>
<a name="fonts_colors"></a>
<p><font color=darkred>
<b>31. Can I control the fonts and colors of the charts?</b>
</font>
<p>
Yes. You can set the font type and font size of all labels, you can set the
chart foreground and background colors, and you can set the color of
each sample in the chart.
<p>
<a href="examples/bar_colors.html">chart color examples</a><br>
<a href="examples/bar_chartlabels.html#colors">chart label colors</a>
<p><br>
<a name="servlets"></a>
<p><font color=darkred>
<b>32. Does EasyCharts support Servlets or Java Server Pages?</b>
</font>
<p>
Yes, EasyCharts 2.5 comes with a generic ChartServlet that generates the
charts as jpeg images.
<p><br>
<a name="servlets_howto"></a>
<p><font size=2 color=darkred>
<b>33. How do I access EasyCharts as a servlet?</b>
</font>
<p>
Install a web server or application server that supports Java(tm) Servlets or
JavaServer Pages(tm). You can find the Tomcat server
<a href="http://java.sun.com/products/jsp/tomcat/">here</a>.
Follow the installation instructions that comes with the distribution.
<p>
Then add the chartServer.jar file to your CLASSPATH or application server.
After added to the path, start your server.
<p>
You can now access the servlet using a standard html image tag:
<p>
<img src="http://server:8080/servlet/com.objectplanet.chart.ChartServlet?<br>
chart=bar&<br>
width=200&height=100&<br>
rangeStep=10&<br>
sampleValues=32,87,46,29,36,45,92,76,34,59,27,63,45"><br>
<p><br>
<a name="javascript"></a>
<p><font color=darkred>
<b>34. Can I control the charts using JavaScript?</b>
</font>
<p>
Yes. Look at <a href="examples/bar_javascript.html">this example</a>
<p><br>
<a name="plotter"></a>
<p><font color=darkred>
<b>35. Can I do plotter charts?</b>
</font>
<p>
Yes and no. In the current version you can not plot x/y values directly.
You can however turn on sample highlight points on the lines, and turn off
the lines to display points only.
<p>
<param name="sampleHighlightOn" value="true"><BR>
<param name="sampleHighlightStyle" value="circle"><BR>
<param name="seriesLineOff" value=true>
<p>
A true plotter chart will be added in later versions.
<p>
<a href="examples/line_highlights.html">line chart plots</a>
<p><br>
<a name="floating_point"></a>
<p><font color=darkred>
<b>36. How do I display floating point data?</b>
</font>
<p>
For a bar and line chart applet, use the following two parameters
<p>
<param name=sampleDecimalCount value=3><BR>
<param name=rangeDecimalCount value=2>
<p>
For a pie chart applet, use the following two parameters
<p>
<param name=sampleDecimalCount value=1><br>
<param name=percentDecimalCount value=1>
<p>
Add floating point data using the sampleValues parameter
<p>
<param name=sampleValues value="1.242, 4.1224, 5.1212, 6.231">
<p>
In a java application, do the following:
<p>
chart.setSampleDecimalCount(2);<BR>
chart.setRangeDecimalCount(2);
<p>
<a href="examples/bar_value.html#decimals">decimal value labels</a>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -