Class

MobileChart


Description

Displays data you provide in chart form of various types.

Events

Name

Parameters

Returns

AppearanceChanged

dark As Boolean

Closing

Error

DataSet As ChartDataSet

Opening

PointerDrag

position As Point, pointerInfo() As PointerEvent

PointerUp

position As Point, pointerInfo() As PointerEvent

Pressed

dataset As ChartDataset, index As Integer

Enumerations

MobileChart.Modes

Modes

The various types of charts available.

Enum

Bar

Bubble

Doughnut

Line

Pie

PolarArea

Radar

Scatter

Stacked

Property descriptions


MobileChart.AccessibilityHint

AccessibilityHint As String

The accessibility hint is a longer description that is read aloud when VoiceOver is enabled.

Me.AccessibilityHint = "Click to calculate the value and display the next screen."

MobileChart.AccessibilityLabel

AccessibilityLabel As String

The accessibility label of of a control is a short name that is read aloud when VoiceOver is enabled.

Me.AccessibilityLabel = "Calculate the value."

MobileChart.AllowPopover

AllowPopover As Boolean

If True, a popover will be displayed when the user positions the mouse over items that have additional information.

The default value is True.


MobileChart.AutoCalculateYAxis

AutoCalculateYAxis As Boolean

If True, the Y axis for Line and Bar charts will start at 0.

This property is True by default.


MobileChart.Backdrop

Backdrop As Picture

The passed Picture that will automatically be drawn behind the chart data.

The following code assigns a jpg image to the Backdrop. The image has been added to the project. The code is in the Opening event.

Me.BackDrop = HouseImage

MobileChart.BackgroundColor

BackgroundColor As ColorGroup

The color of the background of the chart.


MobileChart.ControlCount

ControlCount As Integer

The number of child controls in the control.

This property is read-only.

Important

This property is supported for iOS only.


MobileChart.DatasetCount

DatasetCount As Integer

The number of datasets that have been added to the chart.

This property is read-only.


MobileChart.DatasetLastIndex

DatasetLastIndex As Integer

The index of last dataset added to the chart.

This property is read-only.


MobileChart.Enabled

Enabled As Boolean

When True the control is drawn enabled and responds to user action. When False, the control appears as disabled and does not respond to user actions.


MobileChart.Format

Format As String

Used to format axis values.

It uses the same formatting conventions as the Format function.


MobileChart.GridColor

GridColor As ColorGroup

The color of the chart's grid.


MobileChart.HasLegend

HasLegend As Boolean

If True, the chart's legend will be displayed.


MobileChart.Height

Height As Integer

The height of the control.

This property is read-only on iOS.


MobileChart.IsGridVisible

IsGridVisible As Boolean

Determines if the grid will be drawn or not.


MobileChart.IsYAxisVisible

IsYAxisVisible As Boolean

Determines if the Y axis will be drawn or not.


MobileChart.IsXAxisVisible

IsXAxisVisible As Boolean

Determines if the X axis will be drawn or not.


MobileChart.LabelCount

LabelCount As Integer

The number of labels in the chart.

This property is read-only.


MobileChart.LabelLastIndex

LabelLastIndex As Integer

The index of last label added to the chart.

This property is read-only.


MobileChart.Left

Left As Integer

The position of the left side of the control, relative to the screen.

This property is read-only on iOS.


MobileChart.LegendColor

TextColor As ColorGroup

Gets or sets the color of the legend. The default value is black.

The following example sets the LegendColor.

Me.LegendColor = Color.Red

WebChart.LegendFont

LegendFont As Font

Name of the font used to display the chart legend.

You can enter any font that is installed in the browser or the names of the two metafonts, "System" and "SmallSystem".

This code sets the LegendFont property.

Me.LegendFont = New Font("Helvetica, 24")

MobileChart.LockBottom

LockBottom As Boolean

Determines whether the bottom edge of the control should stay at a set distance from the bottom edge of the parent control, if there is one, or the owning screen.

This property is read-only.


MobileChart.LockLeft

LockLeft As Boolean

Determines whether the left edge of the control should stay at a set distance from the left edge of the parent control, if there is one, or the owning screen.

This property is read-only.


MobileChart.LockRight

LockRight As Boolean

Determines whether the right edge of the control should stay at a set distance from the right edge of the parent control, if there is one, or the owning screen.

This property is read-only.


MobileChart.LockTop

LockTop As Boolean

Determines whether the top edge of the control should stay at a set distance from the top edge of the parent control, if there is one, or the owning screen.

This property is read-only.


MobileChart.Mode

Mode As Modes

Indicates the type of chart the control is currently displaying.

This property is read-only.

Labels are required for a Bar chart to draw.

This example checks the mode of the chart:

If Chart1.Mode = MobileChart.Modes.Bar then
  Chart1.Title = "Sales Bar Chart"
End If

MobileChart.Name

Name As String

The name of the control.

This property is read-only.


MobileChart.Parent

Parent As Object

Used to get the control's parent control or page. If the parent control is a MobileContainer, then it returns the MobileContainer. If it is on a Screen, it returns the Screen.

This property is read-only.


MobileChart.PopoverBackgroundColor

PopoverBackgroundColor As ColorGroup

The background color of the chart's popover.


MobileChart.PopoverTextColor

PopoverTextColor As ColorGroup

The color of text in the chart's popover.


MobileChart.TabIndex

TabIndex As Integer

The control's position in the Tab Order. The control with a TabIndex of 0 is the first control to get the focus when the Screen is displayed.

This example sets the control's TabIndex.

Me.TabIndex = 2

Mobilechart.TextColor

TextColor As ColorGroup

Gets or sets the color of the text. The default value is black.

The following example sets the TextColor.

Me.TextColor = Color.Red

MobileChart.TextFont

TextFont As Font

The font used to display the text content.

You can use any font that is installed on the device.

The System font is the font used by the system software as its default font. Different operating systems use different default fonts. If the system software supports both a large and small System font, you can also specify the "SmallSystem" font.

On iOS, SmallSystem specifies the smaller system font.

This code sets the TextFont property to the System font.

Me.TextFont = Font.SystemFont

MobileChart.TintColor

TintColor As ColorGroup

Changes a control's tint color.

Important

This is supported for iOS only.

On iOS, the following controls support TintColor:

Enum

Description

ProgressBar

The area indicating the value of the control will be drawn in the TintColor.

Slider

The area indicating the value of the control will be drawn in the TintColor.

TextArea

The cursor and text highlight color will be drawn in the TintColor.

TextField

The cursor and text highlight color will be drawn in the TintColor.


MobileChart.Title

Title As String

The title of the chart.


MobileChart.TitleColor

TitleColor As ColorGroup

Gets or sets the color of the title. The default value is black.

The following example sets the TitleColor.

Me.TitleColor = Color.Red

WebChart.TitleFont

TitleFont As Font

Name of the font used to display the chart title.

You can enter any font that is installed in the browser or the names of the two metafonts, "System" and "SmallSystem".

This code sets the TitleFont property.

Me.TitleFont = New Font("Helvetica, 24")

MobileChart.Tooltip

Tooltip As String

Text of a message displayed as a tooltip.

The tip is displayed when the user places the mouse on the control and leaves it there.

This code in the Opening event of a Button sets the tooltip:

Me.Tooltip = "Save changes"

MobileChart.Top

Top As Integer

The top of the control in local coordinates relative to the Screen.

This property is read-only on iOS.


MobileChart.Visible

Visible As Boolean

If True, the control is drawn. If False, it's not.

Hide a control based on a checkbox setting:

If ShowEmailCheckbox.Value Then
  EmailField.Visible = True
Else
  EmailField.Visible = False
End If

MobileChart.Width

Width As Integer

The width of the control.

This property is read-only on iOS.

This code in the Opening event handler increases the size of the control:

Me.Width = Me.Width + 50

Method descriptions


MobileChart.AddConstraint

AddConstraint(constraint As iOSLayoutConstraint)

Adds a constraint to the control.

This constraint is used by child controls that have been added to this control.

Important

This is supported for iOS only.


MobileChart.AddControl

AddControl(child As MobileUIControl)

Adds a child control to the control.

Important

This is supported for iOS only.


MobileChart.AddDataset

AddDataset(dataset As ChartDataset)

Adds the dataset to the chart. Incompatible datasets are ignored.


MobileChart.AddDatasetAt

AddDatasetAt(index As Integer, dataset As ChartDataset)

Adds the dataset to the chart at the index passed. Incompatible datasets are ignored.


MobileChart.AddDatasets

AddDatasets(datasets() As ChartDataset)

Adds the array of datasets to the chart.


MobileChart.AddLabel

AddLabel(name As String)

Adds the label to the chart.


MobileChart.AddLabelAt

AddLabelAt(index As String, name As String)

Adds the label to the chart at the index passed.


MobileChart.AddLabels

AddLabels(names() As String)

Adds the array of labels to the chart.


MobileChart.ClearFocus

ClearFocus

Removes the focus from the control.

TextField1.ClearFocus

MobileChart.ControlAt

ControlAt(index As Integer) As MobileUIControl

Gets the child control at the specified index.

Important

This is supported for iOS only.


MobileChart.Controls

Controls As Iterable

Allows you to iterate through all the controls that have been added to this control.

Important

This is supported for iOS only.


MobileChart.DatasetAt

DatasetAt(index As Integer) As ChartDataset

Returns the ChartDataset at the index passed.


MobileChart.DataSets

DataSets() As Iterable

Allows iterating through all data sets.


MobileChart.Handle

Handle As Ptr

The handle to the underlying native OS control.

Important

This is supported for iOS only.


MobileChart.LabelAt

LabelAt(index As Integer) As String

Returns the label at the index passed.


MobileChart.Labels

Labels() As Iterable

Allows iterating through all labels.


MobileChart.Refresh

Refresh

Marks the control so that it will be redrawn during the next event loop.

Call Refresh to force a Canvas to redraw itself:

Canvas1.Refresh

MobileChart.RemoveAllDatasets

RemoveAllDatasets

Removes all datasets from the chart.


MobileChart.RemoveAllLabels

RemoveAllLabels

Removes all labels from the chart.


MobileChart.RemoveConstraint

RemoveConstraint(constraint As iOSLayoutConstraint)

Removes a constraint from the control.

Important

This is supported for iOS only.


MobileChart.RemoveControl

RemoveControl(child As MobileUIControl)

Removes the control from the control.

Important

This is supported for iOS only.


MobileChart.RemoveDatasetAt

RemoveDatasetAt(index As Integer)

Removes the ChartDataset at the index passed.


MobileChart.RemoveLabelAt

RemoveLabelAt(index As Integer)

Removes the label at the index passed.


MobileChart.SetFocus

SetFocus

Sets the focus to the MobileChart control.


MobileChart.ToPicture

ToPicture(width As Double = -1, height As Double = -1) As Picture

Returns the chart as a Picture at the size specified by the width and height parameters. If these parameters are not specified, the Picture is created using the dimensions of the chart.

Event descriptions


MobileChart.AppearanceChanged

AppearanceChanged(dark As Boolean)

If dark is True then the device has switched to Dark mode. If False then the device has switched to Light mode.


MobileChart.Closing

Closing

The control is about to be removed from the Screen either because the Screen is closing or the control's Close method was called.


MobileChart.Error

Error(DataSet As ChartDataSet)

The chart either has no room to display the data or is too small to draw the grid. The DataSet is the ChartDataSet assigned to the control.


MobileChart.Opening

Opening

The control has been created and the page is opening but has not been sent to the browser yet.

The Opening event handler can be used to initialize non-visual properties and settings for controls.


MobileChart.PointerDrag

PointerDrag(position As Point, pointerInfo() As PointerEvent)

Called when the pointing device (finger or pen) is dragged.


MobileChart.PointerUp

PointerUp(position As Point, pointerInfo() As PointerEvent)

Called when the pointing device (finger or pen) is raised or released.


MobileChart.Pressed

Pressed(dataset As ChartDataset, index As Integer)

The user pressed on a part of the chart that represents data from the dataset.

Compatibility

iOS projects on all supported operating systems.