this has a good explanation https://www.youtube.com/watch?v=B4Vmm3yZPgc


On Fri, 18 Jun 2021 at 19:57, Eugene TUYIZERE <eugenetuyiz...@gmail.com>
wrote:

>
>
> On Thu, 17 Jun 2021 at 11:15, Eugene TUYIZERE <eugenetuyiz...@gmail.com>
> wrote:
>
>> Team,
>>
>> I have a table called Indicators. This includes indicator, target and
>> progress. Both target and progress are numbers. What I want is to display a
>> chart target and progress for every indicator. With the code below I only
>> get indicators I failed to display the bars (columns). Please assist
>>
>> [image: image.png]
>>
>> def chart(request):
>> dataset = Indicators.objects.values('indicator','target','progress')
>> indicator = list()
>> target = list()
>> progress = list()
>> for entry in dataset:
>> indicator.append(entry['indicator'])
>> target.append(entry['target'])
>> progress.append(entry['progress'])
>> target_series = {
>> 'name': 'Target',
>> 'data': target,
>> 'color': 'blue',
>> }
>> progress_series = {
>> 'name': 'Progress',
>> 'data': progress,
>> 'color': 'red'
>> }
>> chart = {
>> 'chart': {'type': 'column'},
>> 'title': {'text': 'Indicator Analysis'},
>> 'xAxis': {'categories': indicator},
>> 'series': [target_series,progress_series]
>> }
>> dump = json.dumps(chart)
>> --
>> *Eugene*
>>
>>
>>
> None to help please
>
>
>
> -
> *Eugene*
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CABxpZHva7h-wkjrRud_k-Oqg400k44g2mqqjCowVxYeZa7cd6g%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CABxpZHva7h-wkjrRud_k-Oqg400k44g2mqqjCowVxYeZa7cd6g%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAGp2JVG1w_tzQj90xhU%3DwTwmbCrhVM%2BsULcva_037_6u_SbMVw%40mail.gmail.com.

Reply via email to