Skip to content

Commit

Permalink
fix scatterChart & demo_all
Browse files Browse the repository at this point in the history
  • Loading branch information
areski committed Apr 12, 2015
1 parent 2860ed1 commit 7933c51
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 23 deletions.
34 changes: 18 additions & 16 deletions examples/demo_all.py
Expand Up @@ -35,18 +35,18 @@
<!DOCTYPE html>
<html lang="en">
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<link href="http://cdnjs.cloudflare.com/ajax/libs/nvd3/1.1.15-beta/nv.d3.css" rel="stylesheet">
<script src="http://cdnjs.cloudflare.com/ajax/libs/d3/3.4.10/d3.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/nvd3/1.1.15-beta/nv.d3.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<link href="//cdnjs.cloudflare.com/ajax/libs/nvd3/1.7.0/nv.d3.min.css" rel="stylesheet" />
<script src="//cdnjs.cloudflare.com/ajax/libs/d3/3.5.5/d3.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/nvd3/1.7.0/nv.d3.min.js"></script>
</head>
"""


output_file.write(html_open)

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

name = "lineChart-different-x-axis"
type = "lineChart"
chart = lineChart(name=name, height=350, x_is_date=False,
chart = lineChart(name=name, height=400, width=800, x_is_date=False,
jquery_on_ready=True)

chart.set_containerheader("\n\n<h2>" + name + "</h2>\n\n")
Expand All @@ -99,7 +99,7 @@
# ---------------------------------------

type = "lineChart"
chart = lineChart(height=350, x_is_date=True, x_axis_format="%d %b %Y %H",
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")
Expand All @@ -125,7 +125,7 @@

type = "lineChartWithInteractiveGuideline"
chart = lineChart(name="lineChart-With-Interactive-Guideline",
height=350, x_is_date=True, x_axis_format="%d %b %Y %H",
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")
Expand All @@ -151,6 +151,7 @@

type = "lineWithFocusChart"
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")

Expand All @@ -164,7 +165,7 @@

extra_serie = {"tooltip": {"y_start": "There is ", "y_end": " calls"},
"date_format": "%d %b %Y %I:%M:%S"}
#extra_serie = None
# extra_serie = None
chart.add_serie(name="serie 1", y=ydata, x=xdata, extra=extra_serie)
chart.add_serie(name="serie 2", y=ydata2, x=xdata, extra=extra_serie)
chart.add_serie(name="serie 3", y=ydata3, x=xdata, extra=extra_serie)
Expand All @@ -177,7 +178,7 @@
# ---------------------------------------

type = "stackedAreaChart"
chart = stackedAreaChart(height=350, x_is_date=True,
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")

Expand All @@ -197,7 +198,7 @@
# ---------------------------------------

type = "linePlusBarChart"
chart = linePlusBarChart(height=350, x_is_date=True,
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")
Expand All @@ -219,7 +220,8 @@
# ---------------------------------------

type = "cumulativeLineChart"
chart = cumulativeLineChart(height=350, x_is_date=True,
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")

Expand All @@ -239,7 +241,7 @@
# ---------------------------------------

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

nb_element = 10
Expand All @@ -257,7 +259,7 @@
# ---------------------------------------

type = "multiBarChart"
chart = multiBarChart(height=350, jquery_on_ready=True)
chart = multiBarChart(height=400, width=800, jquery_on_ready=True)
chart.set_containerheader("\n\n<h2>" + type + "</h2>\n\n")
nb_element = 10
xdata = list(range(nb_element))
Expand All @@ -274,7 +276,7 @@
# ---------------------------------------

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

type = "scatterChart"
chart = scatterChart(height=350, date=False, jquery_on_ready=True)
chart = scatterChart(height=400, width=800, date=False, jquery_on_ready=True)
chart.set_containerheader("\n\n<h2>" + type + "</h2>\n\n")
nb_element = 50
xdata = [i + random.randint(1, 10) for i in range(nb_element)]
Expand Down
2 changes: 1 addition & 1 deletion examples/ipythonDemo.ipynb
Expand Up @@ -316,7 +316,7 @@
" tooltip_str = '<center><b>'+key+'</b></center>' + y + ' at ' + x;\n",
" return tooltip_str;\n",
" });\n",
"chart.scatter.onlyCircles(false); chart.showLegend(true);\n",
"chart.showLegend(true);\n",
" d3.select('#scatterChart_1 svg')\n",
" .datum(data_scatterChart_1)\n",
" .transition().duration(500)\n",
Expand Down
2 changes: 1 addition & 1 deletion examples/scatterChart.py
Expand Up @@ -16,7 +16,7 @@
output_file = open('test_scatterChart.html', 'w')

type = "scatterChart"
chart = scatterChart(name=type, height=350, x_is_date=False)
chart = scatterChart(name=type, height=350, width=800, x_is_date=False)
chart.set_containerheader("\n\n<h2>" + type + "</h2>\n\n")
nb_element = 50
xdata = [i + random.randint(1, 10) for i in range(nb_element)]
Expand Down
4 changes: 1 addition & 3 deletions nvd3/scatterChart.py
Expand Up @@ -86,9 +86,7 @@ class scatterChart(TemplateMixin, NVD3Chart):
return tooltip_str;
});
chart.scatter.onlyCircles(false);
chart.showLegend(true);
chart.showLegend(true);
chart
.showDistX(true)
Expand Down
2 changes: 0 additions & 2 deletions nvd3/templates/scatterchart.html
Expand Up @@ -37,8 +37,6 @@

{% block inject %}

chart.scatter.onlyCircles(false);

chart
.showDistX(true)
.showDistY(true)
Expand Down

0 comments on commit 7933c51

Please sign in to comment.