This paper introduces the histogram as an example, of course, this is only a method; There are many ways to show charts, such as customizing chart labels, using Jfreechart plug-ins, and so on;
1, import JS file, including a lot of display methods:
The code is as follows:
2, from the background to obtain data:
1 2 3 4 5 6 7 8 9
function init () {var name3= "
3. Assign the data to the legend:
1 2 3 4 5 6 7 8 9
Effect drawing source Code reference
For some discrete points, the linear fitting effect diagram of the discrete point is performed using the least squares method.
Source Code
Import Java.awt.Color;
Import Java.io.File;
Import java.io.IOException;
Import java.util.ArrayList;
Import Org.jfree.chart.ChartFactory;
Import Org.jfree.chart.ChartFrame;
Import org.jfree.chart.ChartUtilities;
Import Org.jfree.chart.JFreeChart;
Import Org.jfree.chart.labels.StandardXYToolTipGenerator;
Import Org.jfree.c
Recently used Jfreechart to complete the project's image export task, the Chinese garbled problem whole afternoon, only to finish
Java code
/** * Configuration Font * * @param chart * Jfreechart object/private static void Configfont (Jfreechart chart) {//config font xfont = new Font ("Arial, Font.plain,")//x axis font yfont = new Font ("Arial", Font.plain,)/y ax
Set in Web.xml:
Copy Code code as follows:
Methods in Java classes:
Copy Code code as follows:
public string Getchart (string series[],double score[][],string type[],string name) {
final int num=8;
Defaultcategorydataset defaultcategorydataset = new Defaultcategorydataset ();
for (int i=0;iType[i]=type[i].substring (0, (Type[i].length () }
for (int j=0;jint i=0;for (i=0;iDefaultcategorydataset.addvalue (Score[j][i], series[j], type[i]);}}
4.1. Simple Line chart
Use Categorydataset to provide data for the chart.
DefaultCategoryDataset dataset = new DefaultCategoryDataset(); dataset.addValue(100, "Jan", "Spring Security"); dataset.addValue(150, "Jan", "jBPM 4"); dataset.addValue(300, "Jan", "Ext JS"); dataset.addValue(100, "Jan", "JFreeChart");
If we only draw a polyline, make sure that the second argument is consistent.
Next, use Createlinechart to create the chart.
Garbled in the window environment may be the Jfreechart class library version is high. In Linux there are small blocks garbled solution.Reason: JRE lacks Chinese font1. Log in to the system as root, switch to the jdk_home/jre/lib/fonts directory to execute mkdir fallback create a newdirectory;2. Upload SIMSUN.TTC to fallback directory, execute CP SIMSUN.TTC SIMSUN.TTF copy;Click Simsun.ttc:http://files.cnblogs.com/jiabaode/simsun.zipor download the JA
First import package Jfreechart and Jcommon
Second, configure the Out-of-the-box display class for Web.xml calls
A detailed example of a column chart class
This paper introduces the histogram as an example, of course, this is only a method; There are many ways to show charts, such as customizing chart labels, using Jfreechart plug-ins, and so on;
1, import JS file, including a lot of display methods:
Copy Code code as follows:
2, from the background to obtain data:
function init () {
var name3= "
3. Assign the data to the legend:
function ShowChart4 (names
When we draw with Jfreechart, sometimes the scale on the data axis wants to define itself, such as the scale is 5, do not want to let Jfeechart automatic control, because its own control of the scale sometimes does not adapt to our needs. Numberaxis Numberaxis = (numberaxis) plot.getrangeaxis ();Numberaxis. Setautotickunitselection (FALSE); Double unit=10d;//the length of the scaleNumbertickunit ntu= New Numbertickunit (unit);Numberaxis. Settickunit (
The following bar chart example includes most of the bar chart class settings
file name: index.jsp
Org.jfree.chart.ChartFactory,Org.jfree.chart.JFreeChart,Org.jfree.chart.plot.PlotOrientation,Org.jfree.chart.servlet.ServletUtilities,Org.jfree.data.category.CategoryDataset,Org.jfree.data.general.*,Org.jfree.chart.plot.CategoryPlot,Org.jfree.chart.axis.CategoryAxis,Org.jfree.chart.axis.ValueAxis,Org.jfree.chart.renderer.category.BarRenderer3D,Org.jfree.chart.urls.StandardCategoryURLGenerator,Org
Last week, the chromium version library was developed with a focus on many forms-related changes and battery status APIs (Note: Battery status APIs are actually part of the system information API in device APIs) and performance improvement.
All unsigned and floating-point array types (Note: itAllows JavaScript to support binary data, You can refer to this Article) now the developer tool will display as a normal array. Obtaining heap snapshots is now 1
1. Web API Brief DescriptionRecently, many large platforms have exposed web APIs. such as Baidu map Web API, do map related people are familiar. Exposing the service this way makes it easy to integrate functionality with a wide variety of device and client platforms, and to create a richer HTML experience by using JavaScript in the browser. So I believe that the Web API
For the title of this article, in fact, the literal translation is to create an API endpoint. But, it is really difficult to understand, I still write as API routing bar. Each article, the article, I will all go to carry on the practice operation, strives to write a good point tutorial.This English address-->https://github.com/dingo/api/wiki/creating-
Docker provides the following four types of Api:docker Registry API Docker Hub API Docker API Docker Remote API for ease of use
This article is designed to explore the Docker Registry API, the Docker Hub API, and the OAuth
Java API, Chinese API (download) and Common English API (online)
Java API documentation is essential when writing Java programs.Download the Chinese API from sun.com.cn.You can download it as follows:Http://gceclub.sun.com.cn/Java_Docs/html_zh_CN.zip
APIs in English, includ
With the growing importance of Web API roles, the need to ensure that you can confidently use the Web API in High-value scenarios that can expose sensitive data and operations is becoming more urgent.
We can see clearly that the entire industry is looking for a solution to protect the REST API that relies on the OAuth 2.0 standard. In practice, however, there is
Overview
With the rapid development of Web2.0 and RIA, processing data at the client is becoming a trend. Using the Dojo Data,web developers can establish a unified data access model in different data formats, which makes the data read and write adopt a unified interface, which reduces the complexity of client logic and improves the maintainability and scalability of the program. In this article, we illustrate the technical application of the Read API
The current technical CTP system provides the version of the API version C++SWIGis a C/C++ tool that can be used to convert interfaces to other languages, which can now be supported Python,Java,R .This article introduces the use of the Swig tool to convert the CTP C + + interface API into a Java callable interface under the Windows 32/64-bit platform.1, download the latest
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.