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