Skip to content

Commit

Permalink
[fix](general) replace type by chart_name
Browse files Browse the repository at this point in the history
  • Loading branch information
areski committed Apr 18, 2024
1 parent 56d6f97 commit f907c4a
Show file tree
Hide file tree
Showing 14 changed files with 26 additions and 25 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ bower_components
archive
env
myenv
nvd3_env

htmlcov
test_*.html
Expand Down
2 changes: 1 addition & 1 deletion docs/source/includes/introduction.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ After installation use python-nvd3 as follows ::

chart_name = 'pieChart'
chart = pieChart(name=chart_name, color_category='category20c', height=450, width=450)
chart.set_containerheader("\n\n<h2>" + type + "</h2>\n\n")
chart.set_containerheader("\n\n<h2>" + chart_name + "</h2>\n\n")

xdata = ["Orange", "Banana", "Pear", "Kiwi", "Apple", "Strawberry", "Pineapple"]
ydata = [3, 4, 0, 1, 5, 7, 3]
Expand Down
2 changes: 1 addition & 1 deletion examples/cumulativeLineChart.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

chart_name = "cumulativeLineChart"
chart = cumulativeLineChart(name=chart_name, height=350, x_is_date=True)
chart.set_containerheader("\n\n<h2>" + type + "</h2>\n\n")
chart.set_containerheader("\n\n<h2>" + chart_name + "</h2>\n\n")

xdata = list(range(nb_element))
xdata = [start_time + x * 1000000000 for x in xdata]
Expand Down
24 changes: 12 additions & 12 deletions examples/demo_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@

chart_name = "discreteBarChart"
chart = discreteBarChart(name='my graphname', height=400, width=800, jquery_on_ready=True)
chart.set_containerheader("\n\n<h2>" + type + "</h2>\n\n")
chart.set_containerheader("\n\n<h2>" + chart_name + "</h2>\n\n")
xdata = ["A", "B", "C", "D", "E", "F", "G"]
ydata = [3, 12, -10, 5, 25, -7, 2]

Expand All @@ -61,7 +61,7 @@
chart_name = "pie Chart"
chart = pieChart(name=chart_name, color_category='category20c', height=400,
width=400, jquery_on_ready=True)
chart.set_containerheader("\n\n<h2>" + type + "</h2>\n\n")
chart.set_containerheader("\n\n<h2>" + chart_name + "</h2>\n\n")

color_list = ['orange', 'yellow', '#C5E946', '#95b43f', 'red', '#FF2259', '#F6A641']
extra_serie = {"tooltip": {"y_start": "", "y_end": " cal"}, "color_list": color_list}
Expand Down Expand Up @@ -102,7 +102,7 @@
chart = lineChart(height=400, width=800, x_is_date=True, x_axis_format="%d %b %Y %H",
jquery_on_ready=True)

chart.set_containerheader("\n\n<h2>" + type + "</h2>\n\n")
chart.set_containerheader("\n\n<h2>" + chart_name + "</h2>\n\n")
xdata = list(range(nb_element))
xdata = [start_time + x * 1000000000 for x in xdata]
ydata = [i + random.randint(1, 10) for i in range(nb_element)]
Expand All @@ -128,7 +128,7 @@
height=400, width=800, x_is_date=True, x_axis_format="%d %b %Y %H",
jquery_on_ready=True, use_interactive_guideline=True)

chart.set_containerheader("\n\n<h2>" + type + "</h2>\n\n")
chart.set_containerheader("\n\n<h2>" + chart_name + "</h2>\n\n")
xdata = list(range(nb_element))
xdata = [start_time + x * 1000000000 for x in xdata]
ydata = [i + random.randint(1, 10) for i in range(nb_element)]
Expand All @@ -153,7 +153,7 @@
chart = lineWithFocusChart(color_category='category20b', x_is_date=True,
height=400, width=800,
x_axis_format="%d %b %Y", jquery_on_ready=True)
chart.set_containerheader("\n\n<h2>" + type + "</h2>\n\n")
chart.set_containerheader("\n\n<h2>" + chart_name + "</h2>\n\n")

xdata = list(range(nb_element))
xdata = [start_time + x * 1000000000 for x in xdata]
Expand All @@ -180,7 +180,7 @@
chart_name = "stackedAreaChart"
chart = stackedAreaChart(height=400, width=800, x_is_date=True,
x_axis_format="%d %b %Y %I", jquery_on_ready=True)
chart.set_containerheader("\n\n<h2>" + type + "</h2>\n\n")
chart.set_containerheader("\n\n<h2>" + chart_name + "</h2>\n\n")

xdata = list(range(nb_element))
xdata = [start_time + x * 1000000000 for x in xdata]
Expand All @@ -201,7 +201,7 @@
chart = linePlusBarChart(height=400, width=800, x_is_date=True,
x_axis_format="%d %b %Y", jquery_on_ready=True,
focus_enable=True)
chart.set_containerheader("\n\n<h2>" + type + "</h2>\n\n")
chart.set_containerheader("\n\n<h2>" + chart_name + "</h2>\n\n")

xdata = list(range(nb_element))
xdata = [start_time + x * 1000000000 for x in xdata]
Expand All @@ -223,7 +223,7 @@
chart = cumulativeLineChart(height=400, width=800,
x_is_date=True, x_axis_format="%d %b %Y",
jquery_on_ready=True)
chart.set_containerheader("\n\n<h2>" + type + "</h2>\n\n")
chart.set_containerheader("\n\n<h2>" + chart_name + "</h2>\n\n")

xdata = list(range(nb_element))
xdata = [start_time + x * 1000000000 for x in xdata]
Expand All @@ -242,7 +242,7 @@

chart_name = "multiBarHorizontalChart"
chart = multiBarHorizontalChart(height=400, width=800, jquery_on_ready=True)
chart.set_containerheader("\n\n<h2>" + type + "</h2>\n\n")
chart.set_containerheader("\n\n<h2>" + chart_name + "</h2>\n\n")

nb_element = 10
xdata = list(range(nb_element))
Expand All @@ -260,7 +260,7 @@

chart_name = "multiBarChart"
chart = multiBarChart(height=400, width=800, jquery_on_ready=True)
chart.set_containerheader("\n\n<h2>" + type + "</h2>\n\n")
chart.set_containerheader("\n\n<h2>" + chart_name + "</h2>\n\n")
nb_element = 10
xdata = list(range(nb_element))
ydata = [random.randint(1, 10) for i in range(nb_element)]
Expand All @@ -277,7 +277,7 @@

chart_name = "multiBarChartDate"
chart = multiBarChart(name=chart_name, height=400, width=800, x_is_date=True, jquery_on_ready=True)
chart.set_containerheader("\n\n<h2>" + type + "</h2>\n\n")
chart.set_containerheader("\n\n<h2>" + chart_name + "</h2>\n\n")
nb_element = 100
start_time = int(time.mktime(datetime.datetime(2012, 6, 1).timetuple()) * 1000)
xdata = range(nb_element)
Expand All @@ -299,7 +299,7 @@

chart_name = "scatterChart"
chart = scatterChart(name=chart_name, height=350, width=800, x_is_date=False)
chart.set_containerheader("\n\n<h2>" + type + "</h2>\n\n")
chart.set_containerheader("\n\n<h2>" + chart_name + "</h2>\n\n")
nb_element = 50
xdata = [i + random.randint(1, 10) for i in range(nb_element)]
ydata = [i * random.randint(1, 10) for i in range(nb_element)]
Expand Down
4 changes: 2 additions & 2 deletions examples/discreteBarChart.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

chart_name = "discreteBarChart"
chart = discreteBarChart(name='mygraphname', height=400, width=600, show_values=True, extras="d3.selectAll('#mygraphname text').style('fill', 'red')")
chart.set_containerheader("\n\n<h2>" + type + "</h2>\n\n")
chart.set_containerheader("\n\n<h2>" + chart_name + "</h2>\n\n")
xdata = ["A", "B", "C", "D", "E", "F", "G"]
ydata = [3, 12, -10, 5, 25, -7, 2]

Expand All @@ -36,7 +36,7 @@
chart_name = "discreteBarChart"
chart = discreteBarChart(name='mygraphname', height=400, width=600,
tooltips=False)
chart.set_containerheader("\n\n<h2>" + type + "</h2>\n\n")
chart.set_containerheader("\n\n<h2>" + chart_name + "</h2>\n\n")
xdata = ["A", "B", "C", "D", "E", "F", "G"]
ydata = [3, 12, -10, 5, 25, -7, 2]

Expand Down
2 changes: 1 addition & 1 deletion examples/discreteBarChart_with_date.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
ydata = [i + random.randint(1, 10) for i in range(nb_element)]

chart = discreteBarChart(name=chart_name, height=400, width=600, x_is_date=True, x_axis_format="%d-%b")
chart.set_containerheader("\n\n<h2>" + type + "</h2>\n\n")
chart.set_containerheader("\n\n<h2>" + chart_name + "</h2>\n\n")

extra_serie = {"tooltip": {"y_start": "", "y_end": " cal"}}
chart.add_serie(y=ydata, x=xdata, extra=extra_serie)
Expand Down
2 changes: 1 addition & 1 deletion examples/ipythonDemo.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@
"source": [
"chart_name = 'pieChart'\n",
"chart1 = nvd3.pieChart(name=chart_name, color_category='category20c', height=450, width=450)\n",
"chart1.set_containerheader(\"\\n\\n<h2>\" + type + \"</h2>\\n\\n\")\n",
"chart1.set_containerheader(\"\\n\\n<h2>\" + chart_name + \"</h2>\\n\\n\")\n",
"\n",
"#Create the keys\n",
"xdata = [\"Orange\", \"Banana\", \"Pear\", \"Kiwi\", \"Apple\", \"Strawberry\", \"Pineapple\"]\n",
Expand Down
2 changes: 1 addition & 1 deletion examples/linePlusBarChart.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
chart = linePlusBarChart(name=chart_name, height=350, width=750,
x_is_date=True, x_axis_format="%d %b %Y",
focus_enable=True)
chart.set_containerheader("\n\n<h2>" + type + "</h2>\n\n")
chart.set_containerheader("\n\n<h2>" + chart_name + "</h2>\n\n")

xdata = list(range(nb_element))
xdata = [start_time + x * 1000000000 for x in xdata]
Expand Down
2 changes: 1 addition & 1 deletion examples/lineWithFocusChart.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
chart = lineWithFocusChart(name=chart_name, height=550, width=850,
color_category='category20b', x_is_date=True,
x_axis_format="%d %b %Y %H", focus_enable=True)
chart.set_containerheader("\n\n<h2>" + type + "</h2>\n\n")
chart.set_containerheader("\n\n<h2>" + chart_name + "</h2>\n\n")

xdata = list(range(nb_element))
xdata = [start_time + x * 1000000000 for x in xdata]
Expand Down
2 changes: 1 addition & 1 deletion examples/multiBarChart.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

chart_name = "multiBarChart"
chart = multiBarChart(name=chart_name, height=350)
chart.set_containerheader("\n\n<h2>" + type + "</h2>\n\n")
chart.set_containerheader("\n\n<h2>" + chart_name + "</h2>\n\n")
chart.callback = '''
function(){
d3.selectAll(".nv-bar").on('click',
Expand Down
2 changes: 1 addition & 1 deletion examples/multiBarChart_date.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
chart_name = "multiBarChart"

chart = multiBarChart(name=chart_name, height=350, x_is_date=True)
chart.set_containerheader("\n\n<h2>" + type + "</h2>\n\n")
chart.set_containerheader("\n\n<h2>" + chart_name + "</h2>\n\n")

nb_element = 100
start_time = int(time.mktime(datetime.datetime(2013, 6, 1).timetuple()) * 1000)
Expand Down
2 changes: 1 addition & 1 deletion examples/multiBarHorizontalChart.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

chart_name = "multiBarHorizontalChart"
chart = multiBarHorizontalChart(name=chart_name, height=350)
chart.set_containerheader("\n\n<h2>" + type + "</h2>\n\n")
chart.set_containerheader("\n\n<h2>" + chart_name + "</h2>\n\n")

nb_element = 10
xdata = list(range(nb_element))
Expand Down
2 changes: 1 addition & 1 deletion examples/pieChart.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

chart_name = "pieChart"
chart = pieChart(name=chart_name, color_category='category20c', height=400, width=400, extras="d3.selectAll('#piechart .nv-slice').style('opacity', 0.5);")
chart.set_containerheader("\n\n<h2>" + type + "</h2>\n\n")
chart.set_containerheader("\n\n<h2>" + chart_name + "</h2>\n\n")
chart.callback = '''
function(){
d3.selectAll(".nv-pie .nv-pie .nv-slice").on('click',
Expand Down
2 changes: 1 addition & 1 deletion examples/scatterChart.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

chart_name = "scatterChart"
chart = scatterChart(name=chart_name, height=350, width=800, x_is_date=False)
chart.set_containerheader("\n\n<h2>" + type + "</h2>\n\n")
chart.set_containerheader("\n\n<h2>" + chart_name + "</h2>\n\n")
nb_element = 50
xdata = [i + random.randint(1, 10) for i in range(nb_element)]
ydata = [i * random.randint(1, 10) for i in range(nb_element)]
Expand Down

0 comments on commit f907c4a

Please sign in to comment.