Convert Spatial Statistics Popup Charts for Web Display (Spatial Statistics)

Summary

Prepares interactive pop-up charts for web display by saving them as image attachments to a feature class.

Several tools in the Spatial Statistics and Space Time Pattern Mining toolboxes create output feature classes that include an HTML_CHART field. If you click a feature that contains this field, an interactive chart will appear in the pop-up pane. However, if you share this feature class as a web layer to ArcGIS Online and click a feature in Map Viewer, the chart will not appear in the pop-ups. This tool creates a feature class that contains the pop-up charts as image attachments. If the feature class with image attachments is shared as a web service to ArcGIS Online, the charts will appear in the pop-ups of the web feature layer.

Illustration

Convert Spatial Statistics Popup Charts for Web Display tool Illustration

Usage

  • This tool accepts the output feature class from the following tools: Local Bivariate Relationships, Causal Inference Analysis, Time Series Smoothing, Change Point Detection, Forest Based Forecast, Time Series Clustering, Curve Fit Forecast, Exponential Smoothing Forecast, Time Series Cross Correlation, and Evaluate Forecasts by Location.

  • This tool does not accept netCDF space-time cube files as input. To use the analysis and forecasting results that are stored in a space-time cube as input to this tool, run the Visualize Space Time Cube in 2D tool and create a feature class that enables pop-ups.

  • The output feature class from this tool should have the same rendering as the input feature class. If the rendering is different, reapply the rendering using the Apply Symbology From Layer tool. Use the input feature class as the Symbology Layer parameter value and the output feature class as the Input Layer parameter value.

  • By default, the tool uses half of the cores available. Modify the Parallel Processing Factor environment to change the number of cores that will be used by the tool.

  • To share the output from this tool as a web layer, you must sign in to your ArcGIS Online or ArcGIS Enterprise account in ArcGIS Pro, and share the layers as a web layer. The account must have the privilege to publish hosted feature layers.

  • To see the charts online, view the web feature layer in Map Viewer. The charts will not appear if viewing the web layer in Map Viewer Classic.

  • If the pop-ups in Map Viewer do not contain an image of a chart, you may need to configure the pop-ups. Click the layer then click Pop-ups in the Settings (light) toolbar. Click Add content and choose the Attachments option. The charts will now appear in the pop-ups.

  • The output feature class from the Time Series Smoothing tool will contain features with a blank, <Null>, value in the Time Series HTML Pop-up field. Features with a blank value in this field will not have an image attachment in the output feature class. In Map Viewer, you can apply a filter expression to remove the features that have a blank value in the Time Series HTML Pop-up field.

  • If you run the tool and the x-axis labels in the charts overlap, rerun the tool and check the Rotate X Axis Labels parameter. This parameter reduces overlapping x-axis labels by rotating them 20 degrees.

Parameters

LabelExplanationData Type
Input Features

The feature class that contains the HTML_CHART field with the HTML code to create a pop-up chart. The feature class must have a 32 bit ObjectID - 64 bit Object IDs are not supported.

Feature Layer
Output Features

The output feature class that will contain the pop-up chart of each feature saved as an image attachment.

Feature Class
Width
(Optional)

The width, in pixels, of each image attachment.

Long
Height
(Optional)

The height, in pixels, of each image attachment.

Long
Rotate X Axis Labels
(Optional)

Specifies whether the x-axis labels will be rotated.

  • Checked—The x-axis labels will be rotated 20 degrees.
  • Unchecked—The x-axis labels will not be rotated. This is the default.

Boolean

arcpy.stats.ConvertSSPopup(in_features, out_feature_class, {img_width}, {img_height}, {rotate_x_axis_labels})
NameExplanationData Type
in_features

The feature class that contains the HTML_CHART field with the HTML code to create a pop-up chart. The feature class must have a 32 bit ObjectID - 64 bit Object IDs are not supported.

Feature Layer
out_feature_class

The output feature class that will contain the pop-up chart of each feature saved as an image attachment.

Feature Class
img_width
(Optional)

The width, in pixels, of each image attachment.

Long
img_height
(Optional)

The height, in pixels, of each image attachment.

Long
rotate_x_axis_labels
(Optional)

Specifies whether the x-axis labels will be rotated.

  • ROTATEThe x-axis labels will be rotated 20 degrees.
  • NO_ROTATEThe x-axis labels will not be rotated. This is the default.
Boolean

Code sample

ConvertSSPopup example (Python window)

The following Python script demonstrates how to use the ConvertSSPopup function.

import arcpy
in_features = r"C:\data\health.gdb\LBR_life_expectancy_physical_activity"
out_features_img_attachments = r"C:\data\health.gdb\LBR_popups"

arcpy.stats.ConvertSSPopup(in_features, out_features_img_attachments, None, None, "NO_ROTATE")
ConvertSSPopup example (stand-alone script)

The following Python script demonstrates how to use the ConvertSSPopup function.

import arcpy
arcpy.env.workspace = r"C:\Analysis\health.gdb"

#Run a tool from the Spatial Statistics or Space Time Mining toolbox that generates popup charts
arcpy.LocalBivariateRelationships_stats("us_counties", "life_expectancy", "physical_activity", "LBR_life_expectancy_physical_activity")

# Run the Convert Spatial Statistics Popup Charts for Web Display tool
arcpy.stats.ConvertSSPopup("LBR_life_expectancy_physical_activity", "LBR_popups", None, None, "NO_ROTATE")

Licensing information

  • Basic: Yes
  • Standard: Yes
  • Advanced: Yes

Related topics