How to put several series in 3 dimensions in a highchart correctly?

0

My goal is to create a chart where I have the name, quantity, and date range.

I'm using DotNet.HighChart in C # WebForms.

My chart currently looks like this:

AndIevenknowwhyit'slikethis,Ijustcannotfixit.

Thiserrorisduetothefollowing:

Eachseriesofthisiscomingfromaqueryonly,howevereachqueryofthiswasusedoftheformulagroupbytojointhedatesandwhenhewillplottheserieshetakesthelastandappliestoeverything.

Mycodeisthis:

publicstringTentativaNovoGrafico(){ProjetoBLLprojBLL=newProjetoBLL();Projetoproj=newProjeto();List<Tuple<string,int,string>>massivos=projBLL.GrafQtdMassivosAno();object[,]chartDataMassivos=newobject[massivos.Count,3];inti=0;foreach(Tuple<string,int,string>iteminmassivos){chartDataMassivos.SetValue(item.Item1,i,0);chartDataMassivos.SetValue(item.Item2,i,1);chartDataMassivos.SetValue(item.Item3,i,2);i++;}List<Tuple<string,int,string>>repAtivos=projBLL.GrafQtdRepAtivosAno();object[,]chartDataRepAtivos=newobject[massivos.Count,3];intj=0;foreach(Tuple<string,int,string>iteminmassivos){chartDataRepAtivos.SetValue(item.Item1,j,0);chartDataRepAtivos.SetValue(item.Item2,j,1);chartDataRepAtivos.SetValue(item.Item3,j,2);j++;}List<Tuple<string,int,string>>especiais=projBLL.GrafQtdEspeciaisAno();object[,]chartDataEspeciais=newobject[massivos.Count,3];intk=0;foreach(Tuple<string,int,string>iteminmassivos){chartDataEspeciais.SetValue(item.Item1,k,0);chartDataEspeciais.SetValue(item.Item2,k,1);chartDataEspeciais.SetValue(item.Item3,k,2);k++;}SeriesserieMassivos=newSeries();SeriesserieEspecial=newSeries();SeriesserieRepAtivos=newSeries();serieMassivos.Data=newData(chartDataMassivos);serieEspecial.Data=newData(chartDataEspeciais);serieRepAtivos.Data=newData(chartDataRepAtivos);serieMassivos.Name="Massivos";
        serieEspecial.Name = "Especial";
        serieRepAtivos.Name = "Rep. de Ativos";

        serieMassivos.Type = ChartTypes.Column;
        serieEspecial.Type = ChartTypes.Column;
        serieRepAtivos.Type = ChartTypes.Column;

        Series[] series = new Series[] { serieMassivos, serieEspecial, serieRepAtivos };

        Highcharts chart = new Highcharts("bar").SetTitle(new Title
            {
                Text = "Quantidade Projetos"
            }).SetXAxis(new XAxis
            {
                Categories =
                    new[]
                        {
                            "Jan", "Fev", "Mar", "Abr", "Mai", "Jun", "Jul", "Ago", "Set", "Out", "Nov", "Dez"
                        }
            })

    .SetSeries(series);

        return chart.ToHtmlString();
    }
    
asked by anonymous 23.04.2015 / 19:03

0 answers