 |
Two charts with bars based on the HChart
Source code name: "canvas2D_chartBar.py"
Programming language: Python
Topic: Plots/2D
DMelt Version 1. Last modified: 05/09/2015. License: Pro
https://datamelt.org/code/cache/canvas2D_chartBar_744.py
To run this script using the DMelt IDE,
copy the above URL link to the menu [File]→[Read script from URL] of the DMelt IDE.
from java.awt import Color
from java.awt import Font
from java.util import Random
from math import *
from jhplot import HChart,P1D
c1 = HChart("Canvas",600,600, 2, 1)
c1.setGTitle("Chart examples")
c1.visible()
c1.cd(1,1)
c1.setChartBar3D()
# c1.setNameX("")
# c1.setNameY("Numbers")
# c1.setName("Bar example")
c1.valueBar3D(1.0, "First", "category1");
c1.valueBar3D(4.0, "Second", "category2");
c1.valueBar3D(3.0, "Third", "category3");
c1.update()
c1.cd(2,1)
# c1.setNameX("")
# c1.setNameY("Numbers")
# c1.setName("Bar example")
c1.setChartBar()
c1.valueBar(1.0, "First", "category1");
c1.valueBar(4.0, "Second", "category2");
c1.valueBar(3.0, "Third", "category3");
c1.update()
# export to some image (png,eps,pdf,jpeg...)
# c1.export(Editor.DocMasterName()+".png")
You see the box below because you did not login.