Solved

How to make a line chart or bar chart in WEB page

Posted on 1998-07-01
16
1,089 Views
Last Modified: 2012-08-14
I want to create a line (bar) chart in my WEB page, but I don't want to use image files (gif,jpg...). How to draw line, point, circle... in page?
Thank for your answers.
0
Comment
Question by:ndthang
  • 6
  • 3
  • 2
  • +4
16 Comments
 
LVL 28

Expert Comment

by:sybe
ID: 1844509
Make a table and a colored image of 1x1 pixel. Then display that image with the size you need.

Example:

<table cellspacing=1 cellpadding=0>
<tr valign=bottom bgcolor=#ffffcc>
<td><img src=dot_red.gif width=12 height=120></td>
<td><img src=dot_red.gif width=12 height=71></td>
<td><img src=dot_red.gif width=12 height=81></td>
<td><img src=dot_red.gif width=12 height=114></td>
<td><img src=dot_red.gif width=12 height=150></td>
<td><img src=dot_red.gif width=12 height=136></td>
<td><img src=dot_red.gif width=12 height=119></td>
<td><img src=dot_red.gif width=12 height=134></td>
<td><img src=dot_red.gif width=12 height=67></td>
<td><img src=dot_red.gif width=12 height=66></td>
<td><img src=dot_red.gif width=12 height=109></td>
</tr>
</table>
0
 

Author Comment

by:ndthang
ID: 1844510
Can I use Java or Applet? Example?
0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 1844512
Perhaps a version 4 solution:

<table cellspacing=1 cellpadding=0 WIDTH=200>
<tr><td>-</td><td>-</td><td>-</td><td>-</td><td>+</td><td>-</td><td>-</td><td>-</td><td>-</td><td>1</td><td>-</td><td>-</td><td>-</td><td>-</td><td>+</td><td>-</td><td>-</td><td>-</td><td>-</td><td>2</td></tr>
<tr><td BGCOLOR="RED" COLSPAN=12>1 </td><td BGCOLOR="WHITE" COLSPAN=8>12</td></tr>
<tr><td BGCOLOR="RED" COLSPAN=2>2  </td><td BGCOLOR="WHITE" COLSPAN=18>2</td></tr>
<tr><td BGCOLOR="RED" COLSPAN=3>3  </td><td BGCOLOR="WHITE" COLSPAN=17>3</td></tr>
<tr><td BGCOLOR="RED" COLSPAN=4>4  </td><td BGCOLOR="WHITE" COLSPAN=16>4</td></tr>
<tr><td BGCOLOR="RED" COLSPAN=14>5 </td><td BGCOLOR="WHITE" COLSPAN=6>14</td></tr>
</table>
0
 
LVL 12

Expert Comment

by:Otta
ID: 1844513
Watch out for the user's browser having "proportional" fonts;
all your attempts to "draw" using "fixed-pitch" text-characters
will not align.
0
 

Expert Comment

by:jhagen042698
ID: 1844514
how about making the crart in windows/access/excel andi nporting it into the HTML page
0
 

Expert Comment

by:kessyclown
ID: 1844515
Why not:

<p> I am kessy
</p>

<hr size="10"> (size you can moderate your own)
I just created a bar.
(Then you get a line, bar, or:)
hr color="#0000FF" size="10">
Then your bar is colored without using a picture.

Kessyclown
0
 

Author Comment

by:ndthang
ID: 1844516
All of you don't understand my question.
I want to create a chart (same the chart in Excel). If using image files, size of them is too big. Is there any way to draw that chart by modify some data ( some numbers).
You can program in Java or Applet.
0
 
LVL 12

Expert Comment

by:Otta
ID: 1844517
Why is it "too big" ??
Modems are getting faster, and LAN-connections are fast,
so downloading an image should be no problem.
Disk-space is getting cheaper, so storing the image
should be no problem, either.
0
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 
LVL 28

Expert Comment

by:sybe
ID: 1844518
What do you mean "too big"
i suggested you use a 1x1 pixel image, you can hardly call that big.

But if you want to use Java, you can, there are a lot of applets around which show graphs based on numbers you put in parameters.

One comes with the JDK 1.02, it's called chart.class, see http://www.whatrain.com/javatest/sun/barchart/chart.html

I have found it very quickly on the wen by search for "chart.class" +applet.

A search for "barchart.class" or whatever you think people might call such an applet will give you numerous webpages, and sure some of them will comtain what you want.






0
 

Author Comment

by:ndthang
ID: 1844520
despair
0
 

Author Comment

by:ndthang
ID: 1844521
despair
0
 
LVL 28

Expert Comment

by:sybe
ID: 1844522
Hmm, if none understands your question, then maybe you should try and rephrase it.


0
 

Accepted Solution

by:
hcyu earned 100 total points
ID: 1844524
Yes, you can use Java applet to implement this. I've already used Java to implement several types of charts, eg. bar, pie, speedometer and so on, and they can display real time data too. You can also resize your chart, set title and change color too.
0
 

Author Comment

by:ndthang
ID: 1844526
I want to know the way I'll go on is true, so I accepted that answer. If you know how to make it, I'll thank very much. I am a beginer, so I hope you help me (if you known).
0
 

Author Comment

by:ndthang
ID: 1844528
Thank
0
 

Expert Comment

by:hcyu
ID: 1844529
Hey! I just answered his answer and clearly made his way because I saw some people didn't understand very well. Therefore, I try to clear his question. I think we just want to help others solve their problems. I always appreciate other experts's help that really help me a lot. Of course, if he needs more help, he can ask me more and I will surely reply!!
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Showing your events from Google Calendar in Google Maps Why? I travel all week and I thought it would be ideal if staff in office knew where I was based on my calendar. (OK real reason: my son wanted to see where I would be working, and I thoug…
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now