public class

SupportChartFragment

extends Fragment
java.lang.Object
   ↳ android.support.v4.app.Fragment
     ↳ com.shinobicontrols.charts.SupportChartFragment

Class Overview

Allows a chart to be placed inside an Android android.support.v4.app.Fragment.

SupportChartFragment is a subclass of Fragment which contains the ShinobiChart object. Access to this object can be gained by calling getShinobiChart(); with this the chart can be configured and interacted with. Note, the ShinobiChart will only be available after onCreate(Bundle) has been called in this SupportChartFragment; before then getShinobiChart() will return null. The Android Support Library must be included in your app.

In the trial version of the library, a trial key must be supplied to the chart using its setTrialKey(String) method before it is drawn. If subclassing SupportChartFragment this could be done in the onCreate(Bundle) method, for example. Note, this is only required in the trial version of shinobicharts for Android.

A SupportChartFragment manages the lifecycle of a chart to ensure optimum performance and can be specified directly in XML or in code. By default it (and therefore its ShinobiChart) is set to be retained across Activity re-creation.

It is possible to subclass SupportChartFragment though the superclass implementation of any overridden methods must be called first, before doing any work. You may, for example, want to override onCreate(Bundle) and add the code to initially set up your chart.

Summary

Public Constructors
SupportChartFragment()
Public Methods
final ShinobiChart getShinobiChart()
Returns the ShinobiChart object contained in this fragment.
void onCreate(Bundle savedInstanceState)
Creates the ShinobiChart object held by the SupportChartFragment; before this point calling getShinobiChart() will return null.
View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
Sets the ShinobiChart up as the UI for the SupportChartFragment.
final void onDestroyView()
Manages how the SupportChartFragment's UI is destroyed.
void onPause()
Called when the fragment is no longer resumed.
void onResume()
Called when the fragment is visible to the user and actively running.
[Expand]
Inherited Methods
From class android.support.v4.app.Fragment
From class java.lang.Object
From interface android.content.ComponentCallbacks
From interface android.view.View.OnCreateContextMenuListener

Public Constructors

public SupportChartFragment ()

Public Methods

public final ShinobiChart getShinobiChart ()

Returns the ShinobiChart object contained in this fragment.

Returns
  • The ShinobiChart object contained in this fragment

public void onCreate (Bundle savedInstanceState)

Creates the ShinobiChart object held by the SupportChartFragment; before this point calling getShinobiChart() will return null. By default the SupportChartFragment (and therefore its ShinobiChart) is set to be retained across Activity re-creation.

If subclassing SupportChartFragment, you may want to override this method and add the code to set your chart up. In that case, however, you must call the super implementation first before doing any work.

Parameters
savedInstanceState If the fragment is being re-created from a previous saved state, this is the state.

public View onCreateView (LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)

Sets the ShinobiChart up as the UI for the SupportChartFragment. If overriding this method you must call the super implementation first.

public final void onDestroyView ()

Manages how the SupportChartFragment's UI is destroyed. This method cannot be overridden.

public void onPause ()

Called when the fragment is no longer resumed. If overriding this method you must call the super implementation first.

public void onResume ()

Called when the fragment is visible to the user and actively running. If overriding this method you must call the super implementation first.