

Public Class CIMChartScatterSeries Inherits CIMChartSeries Implements System.ComponentModel.INotifyPropertyChanged, System.Xml.Serialization.IXmlSerializable
public class CIMChartScatterSeries : CIMChartSeries, System.ComponentModel.INotifyPropertyChanged, System.Xml.Serialization.IXmlSerializable
{
//Note: QueuedTask is required to access the feature layer
{
// For more information on the chart CIM specification:
// https://github.com/Esri/cim-spec/blob/main/docs/v3/CIMCharts.md
var lyrDefScatter = featureLayer.GetDefinition();
// Define scatter plot CIM properties
var scatterPlot = new CIMChart
{
Name = "scatterPlot",
GeneralProperties = new CIMChartGeneralProperties
{
Title = $"{xField} vs. {yField}",
UseAutomaticTitle = false
},
Series =
[
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 definition
lyrDefScatter.Charts = allChartsScatter.ToArray();
featureLayer.SetDefinition(lyrDefScatter);
}
}
System.Object
ArcGIS.Core.CIM.CIMObject
ArcGIS.Core.CIM.CIMChartSeries
ArcGIS.Core.CIM.CIMChartScatterSeries
Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)