Ejemplo n.º 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
                    }
                };
            }
        }
Ejemplo n.º 2
0
 public Chart(string title,
              Schema.Specification vegaLiteSpecification,
              Guid?id = null)
     : this(vegaLiteSpecification,
            id)
 {
     Title = title;
 }
Ejemplo n.º 3
0
 public Chart(Schema.Specification vegaLiteSpecification,
              string datasetName,
              Guid?id = null)
     : this(vegaLiteSpecification,
            id)
 {
     Specification.Data.Name = datasetName;
 }
Ejemplo n.º 4
0
 public Chart(Schema.Specification vegaLiteSpecification,
              int width,
              int height,
              Guid?id = null)
     : this(vegaLiteSpecification,
            id)
 {
     Title  = vegaLiteSpecification.Description;
     Width  = width;
     Height = height;
 }
Ejemplo n.º 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;
 }