Merge pull request #448 from JelteF/feature-nolabel

Add feature to pass false as a label so it isn't displayed
This commit is contained in:
Olly Smith 2014-07-14 21:13:06 +01:00
commit 8c100cde86
2 changed files with 6 additions and 0 deletions

View File

@ -221,6 +221,9 @@ class Morris.Bar extends Morris.Grid
row = @data[index] row = @data[index]
content = "<div class='morris-hover-row-label'>#{row.label}</div>" content = "<div class='morris-hover-row-label'>#{row.label}</div>"
for y, j in row.y for y, j in row.y
if @options.labels[j] is false
continue
content += """ content += """
<div class='morris-hover-point' style='color: #{@colorFor(row, j, 'label')}'> <div class='morris-hover-point' style='color: #{@colorFor(row, j, 'label')}'>
#{@options.labels[j]}: #{@options.labels[j]}:

View File

@ -101,6 +101,9 @@ class Morris.Line extends Morris.Grid
row = @data[index] row = @data[index]
content = "<div class='morris-hover-row-label'>#{row.label}</div>" content = "<div class='morris-hover-row-label'>#{row.label}</div>"
for y, j in row.y for y, j in row.y
if @options.labels[j] is false
continue
content += """ content += """
<div class='morris-hover-point' style='color: #{@colorFor(row, j, 'label')}'> <div class='morris-hover-point' style='color: #{@colorFor(row, j, 'label')}'>
#{@options.labels[j]}: #{@options.labels[j]}: