
public class CIMChartScatterSeries : CIMChartSeries, System.ComponentModel.INotifyPropertyChanged, System.Xml.Serialization.IXmlSerializable
Public Class CIMChartScatterSeries Inherits CIMChartSeries Implements System.ComponentModel.INotifyPropertyChanged, System.Xml.Serialization.IXmlSerializable
// For more information on the chart CIM specification: // https://github.com/Esri/cim-spec/blob/main/docs/v3/CIMCharts.md // Define fields names used in chart parameters. const string xField = "minimum_nights"; const string yField = "price"; var lyrsScatter = MapView.Active.Map.GetLayersAsFlattenedList().OfType<FeatureLayer>(); var lyrScatter = lyrsScatter.First(); var lyrDefScatter = lyrScatter.GetDefinition(); // Define scatter plot CIM properties var scatterPlot = new CIMChart { Name = "scatterPlot", GeneralProperties = new CIMChartGeneralProperties { Title = $"{xField} vs. {yField}", UseAutomaticTitle = false }, Series = new CIMChartSeries[] { new CIMChartScatterSeries { UniqueName = "scatterPlotSeries", Name = "scatterPlotSeries", // Specify the X and Y field names Fields = new string[] { xField , yField }, // Turn on trend line ShowTrendLine = true } } }; // Add new chart to layer's existing list of charts (if any exist) var newChartsScatter = new CIMChart[] { scatterPlot }; var allChartsScatter = (lyrDefScatter == null) ? newChartsScatter : lyrDefScatter.Charts.Concat(newChartsScatter); // Add CIM chart to layer defintion lyrDefScatter.Charts = allChartsScatter.ToArray(); lyrScatter.SetDefinition(lyrDefScatter);
System.Object
ArcGIS.Core.CIM.CIMObject
ArcGIS.Core.CIM.CIMChartSeries
ArcGIS.Core.CIM.CIMChartScatterSeries
Target Platforms: Windows 11, Windows 10