Web Statistical Chart solution

Source: Internet
Author: User
Tags custom name
With the rise of internet technology, Xu Changyou has seen more and more B/S-structured programs. There are many ways to implement statistical charts on the web, which is more difficult to implement than general applications. This article mainly introduces the implementation method of Web statistical charts, and makes statistics and analysis on various types of information. In order to provide a decision-making basis and visually present the analysis results, let the information be displayed in an intuitive form by combining the bar chart, line chart, and pie chart with the data warehouse rotation analysis! Charts are used in many projects, and some articles on the Internet are viewed. Most of the B/S structures are implemented using components such as MS chart, pie graph, and aspchart, most of these components are developed by foreign software companies and require money. The final effect looks poor (I think) and has some disadvantages, for example, the MS chart client must have an office, otherwise it cannot be used. In addition, some applications are implemented using the applet, such as the Java Chart Toolkit, which is written in Java and is suitable for browsers that support Java Applet. If Java is not used, it is difficult for general applications to use them. This article provides you with a Statistical Chart solution. Of course, you can use it in all areas that support ActiveX, not just web. After reading this article, I think you can also use ASP, VBScript, and JavaScript to complete statistical charts. The most important thing is that you can write copyright (C), yourcompany.... The client allows the browser to automatically download and register without installation. Next, we will use Delphi to develop an ActiveX that can generate statistical charts on a browser (the same is true with BCB, but the code is a little different): First, open Delphi, choose File> new from the menu, select acitvex form from new items, and enter a custom name, for example, MyChart, for new acitvex name in acitveform winzard. The following options can be selected as needed, here, only include aboutbox is selected, so that Delphi will automatically generate a dialog box. Place a tchart component in the MyChart window, and add a bar-shaped series in tchart. You can set the specific situation. This article only gives a brief introduction. We recommend that you use a method to dynamically generate a series. In the menu view-> type libary, add two methods: add_data and clear_data to add and clear data respectively. Add two parameters (anum, type: Double, aname, type: BSTR, modifier set to in) to the add_data method. The Code is as follows: Procedure tmychart. add_data (anum: Double; const aname: widestring); begin series1.add (anum, aname, clteecolor); end;

Procedure tmychart. clear_data; begin series1.clear; end; Set aboutbox and add a tpopupmenu to the MyChart window. The dialog box appears. Add a menuitem to set caption: = "about (& )... ", onclick code is as follows: Procedure tmychart. pm_aboutclick (Sender: tobject); begin showmychartabout; end; displays information about the dialog box and sets the popupmenu of tchart to the added tpopupmenu! If the project name is not changed, compile and generate mychartproj1.ocx, and register this control. For browsers, you can use the following method to allow others to automatically register it: in Delphi, you can set web publishing options through project-> Web deloyment options. The simple setting is as follows: Target dir: C: /document and settings/Administrator/desktop/chart/html target URL :. HTML dir: C:/document and settings/Administrator/desktop/chart/HTML, and then click Project> Web deploy in C: the/document and settings/Administrator/desktop/chart/html directory generates two files, one HTML file and the other ocx file. Change the HTML file with ID = mychart1 and add the following VBScript code: <HTML>

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.