dataviz: hide y label for one dimension dot chart type with title (#73686) #51
|
@ -393,6 +393,8 @@ class ChartNgCell(CellBase):
|
|||
for label, data in zip(chart.x_labels, data["series"][0]["data"])
|
||||
if data
|
||||
]
|
||||
elif self.chart_type == 'dot':
|
||||
data['series'][0]['label'] = ''
|
||||
|
||||
if self.chart_type == 'stacked-bar-percent':
|
||||
self.make_percent([serie['data'] for serie in data['series']])
|
||||
|
|
|
@ -1599,6 +1599,26 @@ def test_chartng_cell_view_new_api_no_data(app, normal_user, new_api_statistics)
|
|||
assert '>4242<' in resp.text
|
||||
|
||||
|
||||
@with_httmock(new_api_mock)
|
||||
def test_chartng_cell_view_new_api_dot_chart_hide_y_label(app, normal_user, new_api_statistics):
|
||||
page = Page.objects.create(title='One', slug='index')
|
||||
cell = ChartNgCell(page=page, order=1, placeholder='content')
|
||||
cell.statistic = Statistic.objects.get(slug='one-serie')
|
||||
cell.chart_type = 'dot'
|
||||
cell.save()
|
||||
|
||||
location = '/api/dataviz/graph/%s/' % cell.id
|
||||
resp = app.get(location + '?width=400', status=200)
|
||||
assert 'Serie 1' not in resp.text
|
||||
|
||||
cell.statistic = Statistic.objects.get(slug='two-series')
|
||||
cell.save()
|
||||
|
||||
resp = app.get(location + '?width=400', status=200)
|
||||
assert 'Serie 1' in resp.text
|
||||
assert 'Serie 2' in resp.text
|
||||
|
||||
|
||||
@with_httmock(bijoe_mock)
|
||||
def test_chartng_cell_manager(app, admin_user, statistics):
|
||||
page = Page(title='One', slug='index')
|
||||
|
|
Loading…
Reference in New Issue