• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Create chart labels using javascript

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have created a bar chart along x axis. I need to label the x axis with the provided min, max numbers. For ex: if [min,max] are [0, 1000] and 5 ticks. suppose the width of the chart is 500 px. So i would have to arrange 0,200,400,600,800,1000 in 500 px width. But if the [min,max] changes, example [0,100], 5 ticks, 500 px width, the alignment and spacing between the labels should be appropriate. I have seen many javascipt codes, but they they are very long with many features and it was difficult to segregate the part i need, that is just to space the labes labels based on [min,max], number of labels and width of chart.

could anyone provide the javascript for creating labels when the width of chart, min and max points, number of labels on chart are provided.(no jquery)
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If this was my problem I'd get up to sped with one of the many fine freely available JavaScript charting libraries. Sure, they do more than you need right now, but once you've mastered it I'm sure you can think of more uses for it :-)
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic