public TreemapChart DrawChart(List<List<string>> indexes, List<double> size, List<object> colors, TreemapParameters parameters)
        {
            if (Chart == null)
                throw new Exception("Excel Chart should be initiliazed in order to Draw Chart");

            Indexes = indexes;
            Sizes = size;
            Colors = colors;
            Parameters = parameters;

            CompileInputs();
            SetTreemapData();
            AutoBuildAndDraw();

            return this;
        }
Ejemplo n.º 2
0
        public TreemapChart DrawChart(List <List <string> > indexes, List <double> size, List <object> colors, TreemapParameters parameters)
        {
            if (Chart == null)
            {
                throw new Exception("Excel Chart should be initiliazed in order to Draw Chart");
            }

            Indexes    = indexes;
            Sizes      = size;
            Colors     = colors;
            Parameters = parameters;

            CompileInputs();
            SetTreemapData();
            AutoBuildAndDraw();

            return(this);
        }
        private TreemapParameters GetParameters()
        {
            TreemapParameters parameters = new TreemapParameters();
            parameters.ShowTitle = ShowTitle;
            parameters.Title = String.IsNullOrEmpty(Title.Value) ? SizeColumn : Title.Value;
            parameters.Algorithm = Algorithm;

            foreach (TreemapIndexViewModel index in Indexes)
                parameters.AddIndex(index.GetTreemapIndex());

            parameters.WithColor(GetColorModel());

            parameters.ShowLegend = ShowLegend;
            parameters.LegendTitle = ColorColumn;
            parameters.LegendPosition = LegendPosition;
            parameters.LegendBorder = parameters.Indexes.Last().GetLineOptions().With(o => o.Weight = o.Weight.Cap(1));
            parameters.LegendTextFormater.FormatType = LegendFormatType;
            parameters.LegendTextFormater.DecimalPlaces = LegendDecimalPlaces;
            return parameters;
        }