Exemple #1
0
        public Chart(Schema.Specification vegaLiteSpecification,
                     Guid?id = null)
            : this(id)
        {
            Specification = vegaLiteSpecification;

            if (string.IsNullOrEmpty(Specification.Data?.Name) && string.IsNullOrEmpty(Specification.Spec?.DataSource?.Name))
            {
                if (Specification.Data == null)
                {
                    Specification.Data = new Schema.DataSource();
                }

                Specification.Data.Name = $"dataset_{Id.ToString().Replace("-", "")}";
            }

            if (Specification.Config == null)
            {
                Specification.Config = new Schema.Config()
                {
                    Legend = new Schema.LegendConfig()
                    {
                        Orient = Schema.LegendOrient.Top
                    }
                };
            }
        }
Exemple #2
0
 public Chart(string title,
              Schema.Specification vegaLiteSpecification,
              Guid?id = null)
     : this(vegaLiteSpecification,
            id)
 {
     Title = title;
 }
Exemple #3
0
 public Chart(Schema.Specification vegaLiteSpecification,
              string datasetName,
              Guid?id = null)
     : this(vegaLiteSpecification,
            id)
 {
     Specification.Data.Name = datasetName;
 }
Exemple #4
0
 public Chart(Schema.Specification vegaLiteSpecification,
              int width,
              int height,
              Guid?id = null)
     : this(vegaLiteSpecification,
            id)
 {
     Title  = vegaLiteSpecification.Description;
     Width  = width;
     Height = height;
 }
Exemple #5
0
 public Chart(string title,
              Schema.Specification vegaLiteSpecification,
              int width,
              int height,
              Guid?id = null)
     : this(vegaLiteSpecification,
            id)
 {
     Title  = title;
     Width  = width;
     Height = height;
 }