ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Core.CIM Namespace / CIMChartLineSymbolProperties Class
Members Example

In This Topic
    CIMChartLineSymbolProperties Class
    In This Topic
    Provides access to members that control properties of the line symbol.
    Object Model
    CIMChartLineSymbolProperties ClassCIMChartLineSymbolProperties ClassCIMColor ClassCIMChartLineSymbolProperties Class
    Syntax
    Example
    Create a line chart with custom time binning and style
    {
      // For more information on the chart CIM specification:
      // https://github.com/Esri/cim-spec/blob/main/docs/v3/CIMCharts.md
    
      // Note: QueuedTask is required to access the feature layer
      {
        var lyrDefLine = featureLayer.GetDefinition();
    
        // Define line chart CIM properties
        var lineChart = new CIMChart
        {
          Name = "lineChart",
          GeneralProperties = new CIMChartGeneralProperties
          {
            Title = $"Line chart for {dateField} summarized by {numericField}",
            UseAutomaticTitle = false
          },
          Series =
            [
                new CIMChartLineSeries {
                  UniqueName = "lineChartSeries",
                  Name = $"Sum({numericField})",
                  // Specify date field and numeric field
                  Fields = new string[] { dateField, numericField },
                  // Specify aggregation type
                  FieldAggregation = new string[] { string.Empty, "SUM" },
                  // Specify custom time bin of 6 months
                  TimeAggregationType = ChartTimeAggregationType.EqualIntervalsFromStartTime,
                  TimeIntervalSize = 6.0,
                  TimeIntervalUnits = esriTimeUnits.esriTimeUnitsMonths,
                  // NOTE: When setting custom time binning, be sure to set CalculateAutomaticTimeInterval = false
                  CalculateAutomaticTimeInterval = false,
                  // Define custom line color
                  ColorType = ChartColorType.CustomColor,
                  LineSymbolProperties = new CIMChartLineSymbolProperties {
                      Style = ChartLineDashStyle.DashDot,
                      Color = new CIMRGBColor { R = 0, G = 150, B = 20 },
                  },
                  MarkerSymbolProperties = new CIMChartMarkerSymbolProperties
                  {
                      Color = new CIMRGBColor { R = 0, G = 150, B = 20 }
                  }
              },
          ]
        };
    
        // Add new chart to layer's existing list of charts (if any exist)
        var newChartsLine = new CIMChart[] { lineChart };
        var allChartsLine = (lyrDefLine == null) ? newChartsLine : lyrDefLine.Charts.Concat(newChartsLine);
        // Add CIM chart to layer definition
        lyrDefLine.Charts = allChartsLine.ToArray();
        featureLayer.SetDefinition(lyrDefLine);
      }
    }
    Inheritance Hierarchy

    System.Object
       ArcGIS.Core.CIM.CIMObject
          ArcGIS.Core.CIM.CIMChartLineSymbolProperties

    Requirements

    Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)

    ArcGIS Pro version: 3.0 or higher.
    See Also