Chart Component: Programatically setting Y axis label?

I have a window in my project that is used to display certain data with a Chart component depending on the table names and columns that are passed into the window (as string parameters) when it is opened. I did some experimenting and found that I can create all my Axes ahead of time, and then use:

chartObject.setDatasetYAxis('Data','AxisNameHere')

to select the axis. The first string is the dataset name (which by default is ‘Data’). The second parameter is the axis name (which is ‘Default Y Axis’ by default). I was wondering if I could just use a single axis and update the axis’s “Display Label” property when the screen opens, simply because I have multiple charts on the screen and would like to do this for all of them. Currently, I pass the Units of the data I’m plotting into the window when I open it, so at the moment I’m creating a series of Y Axes with the same name (and display label) as the units. It will work this way, but I would like to automate the process a bit more.

For reference, here are the methods returned when performing print dir(chartObject)

['ABORT', 'ALLBITS', 'AccessibleJComponent', 'BOTTOM_ALIGNMENT', 'BaselineResizeBehavior', 'CENTER_ALIGNMENT', 'CHART_CATEGORY', 'CHART_XY', 'COMPONENT_LOCKED', 'COMPONENT_PERMISSIONS', 'COMPONENT_RUNNING', 'COMPONENT_SECURITY', 'DEFAULT_BUFFER_USED', 'DEFAULT_HEIGHT', 'DEFAULT_MAXIMUM_DRAW_HEIGHT', 'DEFAULT_MAXIMUM_DRAW_WIDTH', 'DEFAULT_MINIMUM_DRAW_HEIGHT', 'DEFAULT_MINIMUM_DRAW_WIDTH', 'DEFAULT_WIDTH', 'DEFAULT_X_AXIS_NAME', 'DEFAULT_Y_AXIS_NAME', 'DEFAULT_ZOOM_TRIGGER_DISTANCE', 'ERROR', 'FRAMEBITS', 'HEIGHT', 'LEFT_ALIGNMENT', 'NO_SUCH_PAGE', 'ORIENTATION_HORIZONTAL', 'ORIENTATION_VERTICAL', 'PAGE_EXISTS', 'PRINT_COMMAND', 'PROPERTIES', 'PROPERTIES_COMMAND', 'RESERVED_SET_KEY', 'RIGHT_ALIGNMENT', 'SAVE_COMMAND', 'SHARED_DOMAIN', 'SHARED_RANGE', 'SOMEBITS', 'TOOL_TIP_TEXT_KEY', 'TOP_ALIGNMENT', 'UI', 'UIClassID', 'UNDEFINED_CONDITION', 'WHEN_ANCESTOR_OF_FOCUSED_COMPONENT', 'WHEN_FOCUSED', 'WHEN_IN_FOCUSED_WINDOW', 'WIDTH', 'XAxes', 'YAxes', 'ZOOM_IN_BOTH_COMMAND', 'ZOOM_IN_DOMAIN_COMMAND', 'ZOOM_IN_RANGE_COMMAND', 'ZOOM_OUT_BOTH_COMMAND', 'ZOOM_OUT_DOMAIN_COMMAND', 'ZOOM_OUT_RANGE_COMMAND', 'ZOOM_RESET_BOTH_COMMAND', 'ZOOM_RESET_DOMAIN_COMMAND', 'ZOOM_RESET_RANGE_COMMAND', '__class__', '__copy__', '__deepcopy__', '__delattr__', '__doc__', '__eq__', '__getattribute__', '__hash__', '__init__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__str__', '__unicode__', 'accessibleContext', 'action', 'actionMap', 'actionPerformed', 'add', 'addAncestorListener', 'addChartMouseListener', 'addComponentListener', 'addContainerListener', 'addFocusListener', 'addHierarchyBoundsListener', 'addHierarchyListener', 'addInputMethodListener', 'addKeyListener', 'addMouseListener', 'addMouseMotionListener', 'addMouseWheelListener', 'addNotify', 'addPropertyChangeListener', 'addVetoableChangeListener', 'alignmentX', 'alignmentY', 'ancestorAdded', 'ancestorListener', 'ancestorListeners', 'ancestorMoved', 'ancestorRemoved', 'ancestorResized', 'anchor', 'appContext', 'applyComponentOrientation', 'areFocusTraversalKeysSet', 'autoscrolls', 'background', 'backgroundSet', 'baselineResizeBehavior', 'border', 'bounds', 'caretPositionChanged', 'chart', 'chartChanged', 'chartMouseClicked', 'chartMouseListener', 'chartMouseMoved', 'chartProgress', 'chartRenderingInfo', 'chartType', 'checkImage', 'class', 'clearSelection', 'colorModel', 'componentAdded', 'componentCount', 'componentHidden', 'componentListener', 'componentListeners', 'componentMoved', 'componentOrientation', 'componentPopupMenu', 'componentRemoved', 'componentResized', 'componentShown', 'components', 'computeVisibleRect', 'containerListener', 'containerListeners', 'contains', 'countComponents', 'createChart', 'createChartPrintJob', 'createImage', 'createToolTip', 'createVolatileImage', 'cursor', 'cursorCode', 'cursorSet', 'dataQuality', 'debugGraphicsOptions', 'defaultDirectoryForSaveAs', 'deliverEvent', 'disable', 'dismissDelay', 'dispatchEvent', 'displayToolTips', 'displayable', 'doEditChartProperties', 'doLayout', 'doSaveAs', 'domainZoomable', 'doubleBuffered', 'dropTarget', 'dynamicProps', 'enable', 'enableInputMethods', 'enabled', 'enforceFileExtensions', 'entityToString', 'equals', 'extractOrder', 'fillZoomRectangle', 'findComponentAt', 'firePropertyChange', 'focusCycleRoot', 'focusCycleRootAncestor', 'focusGained', 'focusListener', 'focusListeners', 'focusLost', 'focusOwner', 'focusTraversable', 'focusTraversalKeysEnabled', 'focusTraversalPolicy', 'focusTraversalPolicyProvider', 'focusTraversalPolicySet', 'focusable', 'font', 'fontSet', 'foreground', 'foregroundSet', 'getAccessibleContext', 'getActionForKeyStroke', 'getActionMap', 'getAlignmentX', 'getAlignmentY', 'getAncestorListeners', 'getAnchor', 'getAppContext', 'getAutoscrolls', 'getBackground', 'getBaseline', 'getBaselineResizeBehavior', 'getBorder', 'getBounds', 'getChart', 'getChartRenderingInfo', 'getChartType', 'getClass', 'getClientProperty', 'getColorModel', 'getComponent', 'getComponentAt', 'getComponentCount', 'getComponentListeners', 'getComponentOrientation', 'getComponentPopupMenu', 'getComponentZOrder', 'getComponents', 'getConditionForKeyStroke', 'getContainerListeners', 'getCursor', 'getCursorCode', 'getDataQuality', 'getDebugGraphicsOptions', 'getDefaultDirectoryForSaveAs', 'getDefaultLocale', 'getDismissDelay', 'getDropTarget', 'getDynamicProps', 'getEntityForPoint', 'getExtractOrder', 'getFillZoomRectangle', 'getFocusCycleRootAncestor', 'getFocusListeners', 'getFocusTraversalKeys', 'getFocusTraversalKeysEnabled', 'getFocusTraversalPolicy', 'getFont', 'getFontMetrics', 'getForeground', 'getGraphics', 'getGraphicsConfiguration', 'getGridlineColor', 'getGridlineDashPattern', 'getGridlineStroke', 'getGridlineWidth', 'getHeight', 'getHierarchyBoundsListeners', 'getHierarchyListeners', 'getHorizontalAxisTrace', 'getIgnoreRepaint', 'getInheritsPopupMenu', 'getInitialDelay', 'getInputContext', 'getInputMap', 'getInputMethodListeners', 'getInputMethodRequests', 'getInputVerifier', 'getInsets', 'getKeyListeners', 'getLayout', 'getListeners', 'getLocale', 'getLocation', 'getLocationOnScreen', 'getMaximumDrawHeight', 'getMaximumDrawWidth', 'getMaximumSize', 'getMinimumDrawHeight', 'getMinimumDrawWidth', 'getMinimumSize', 'getMouseListeners', 'getMouseMotionListeners', 'getMousePosition', 'getMouseWheelListeners', 'getName', 'getNextFocusableComponent', 'getOrientation', 'getPNGBytes', 'getParent', 'getPeer', 'getPlotBackground', 'getPlotProperties', 'getPointInRectangle', 'getPopupLocation', 'getPopupMenu', 'getPreferredSize', 'getProperties', 'getPropertiesLoading', 'getPropertyChangeListeners', 'getPropertyValue', 'getRefreshBuffer', 'getRegisteredKeyStrokes', 'getReshowDelay', 'getRootPane', 'getScaleX', 'getScaleY', 'getScreenDataArea', 'getSelectedData', 'getSelectedXValue', 'getSelectionHighlightColor', 'getSelectionHighlightWidth', 'getSize', 'getSubplotMode', 'getTitle', 'getTitleFont', 'getToolTipLocation', 'getToolTipText', 'getToolkit', 'getTopLevelAncestor', 'getTransferHandler', 'getTreeLock', 'getUI', 'getUIClassID', 'getVerifyInputWhenFocusTarget', 'getVerticalAxisTrace', 'getVetoableChangeListeners', 'getVisibleRect', 'getWidth', 'getX', 'getXAxes', 'getY', 'getYAxes', 'getZoomAroundAnchor', 'getZoomInFactor', 'getZoomOutFactor', 'getZoomTriggerDistance', 'gotFocus', 'grabFocus', 'graphics', 'graphicsConfiguration', 'gridlineColor', 'gridlineDashPattern', 'gridlineStroke', 'gridlineWidth', 'handleEvent', 'hasFocus', 'hashCode', 'height', 'hide', 'hierarchyBoundsListener', 'hierarchyBoundsListeners', 'hierarchyChanged', 'hierarchyListener', 'hierarchyListeners', 'horizontalAxisTrace', 'ignoreRepaint', 'imageUpdate', 'inheritsPopupMenu', 'initialDelay', 'initialize', 'inputContext', 'inputMap', 'inputMethodListener', 'inputMethodListeners', 'inputMethodRequests', 'inputMethodTextChanged', 'inputVerifier', 'insets', 'inside', 'invalidate', 'isAncestorOf', 'isBackgroundSet', 'isCursorSet', 'isDisplayable', 'isDomainZoomable', 'isDoubleBuffered', 'isEnabled', 'isEnforceFileExtensions', 'isFocusCycleRoot', 'isFocusOwner', 'isFocusTraversable', 'isFocusTraversalPolicyProvider', 'isFocusTraversalPolicySet', 'isFocusable', 'isFontSet', 'isForegroundSet', 'isLegend', 'isLightweight', 'isLightweightComponent', 'isManagingFocus', 'isMaximumSizeSet', 'isMinimumSizeSet', 'isOpaque', 'isOptimizedDrawingEnabled', 'isPaintingForPrint', 'isPaintingTile', 'isPreferredSizeSet', 'isPropertyDefined', 'isRangeZoomable', 'isRequestFocusEnabled', 'isSelectionEnabled', 'isShowPopup', 'isShowing', 'isTooltips', 'isValid', 'isValidateRoot', 'isVisible', 'keyDown', 'keyListener', 'keyListeners', 'keyPressed', 'keyReleased', 'keyTyped', 'keyUp', 'layout', 'legend', 'lightweight', 'list', 'locale', 'locate', 'location', 'locationOnScreen', 'lostFocus', 'managingFocus', 'maximumDrawHeight', 'maximumDrawWidth', 'maximumSize', 'maximumSizeSet', 'minimumDrawHeight', 'minimumDrawWidth', 'minimumSize', 'minimumSizeSet', 'mode', 'mouseClicked', 'mouseDown', 'mouseDrag', 'mouseDragged', 'mouseEnter', 'mouseEntered', 'mouseExit', 'mouseExited', 'mouseListener', 'mouseListeners', 'mouseMotionListener', 'mouseMotionListeners', 'mouseMove', 'mouseMoved', 'mousePosition', 'mousePressed', 'mouseReleased', 'mouseUp', 'mouseWheelListener', 'mouseWheelListeners', 'mouseWheelMoved', 'mouseZoomable', 'move', 'name', 'nextFocus', 'nextFocusableComponent', 'notify', 'notifyAll', 'opaque', 'optimizedDrawingEnabled', 'orientation', 'paint', 'paintAll', 'paintComponent', 'paintComponents', 'paintImmediately', 'paintingForPrint', 'paintingTile', 'parent', 'peer', 'plotBackground', 'plotProperties', 'popupMenu', 'postEvent', 'preferredSize', 'preferredSizeSet', 'prepareImage', 'print', 'printAll', 'printComponents', 'properties', 'propertiesLoading', 'propertyChange', 'propertyChangeListener', 'propertyChangeListeners', 'putClientProperty', 'rangeZoomable', 'refreshBuffer', 'refreshChart', 'registerKeyboardAction', 'registeredKeyStrokes', 'remove', 'removeAll', 'removeAncestorListener', 'removeChartMouseListener', 'removeComponentListener', 'removeContainerListener', 'removeFocusListener', 'removeHierarchyBoundsListener', 'removeHierarchyListener', 'removeInputMethodListener', 'removeKeyListener', 'removeMouseListener', 'removeMouseMotionListener', 'removeMouseWheelListener', 'removeNotify', 'removePropertyChangeListener', 'removeVetoableChangeListener', 'repaint', 'requestDefaultFocus', 'requestFocus', 'requestFocusEnabled', 'requestFocusInWindow', 'resetKeyboardActions', 'reshape', 'reshowDelay', 'resize', 'restoreAutoBounds', 'restoreAutoDomainBounds', 'restoreAutoRangeBounds', 'revalidate', 'rootPane', 'saveAsImage', 'scale', 'scaleX', 'scaleY', 'screenDataArea', 'scrollRectToVisible', 'selectedData', 'selectedXValue', 'selectionEnabled', 'selectionHighlightColor', 'selectionHighlightWidth', 'setActionMap', 'setAlignmentX', 'setAlignmentY', 'setAutoscrolls', 'setBackground', 'setBorder', 'setBounds', 'setChart', 'setChartType', 'setComponentOrientation', 'setComponentPopupMenu', 'setComponentZOrder', 'setCursor', 'setCursorCode', 'setDataQuality', 'setDatasetEnabled', 'setDatasetPlotNumber', 'setDatasetXAxis', 'setDatasetYAxis', 'setDebugGraphicsOptions', 'setDefaultDirectoryForSaveAs', 'setDefaultLocale', 'setDismissDelay', 'setDisplayToolTips', 'setDomainZoomable', 'setDoubleBuffered', 'setDropTarget', 'setDynamicProps', 'setEnabled', 'setEnforceFileExtensions', 'setExtractOrder', 'setFillZoomRectangle', 'setFocusCycleRoot', 'setFocusTraversalKeys', 'setFocusTraversalKeysEnabled', 'setFocusTraversalPolicy', 'setFocusTraversalPolicyProvider', 'setFocusable', 'setFont', 'setForeground', 'setGridlineColor', 'setGridlineDashPattern', 'setGridlineWidth', 'setHorizontalAxisTrace', 'setIgnoreRepaint', 'setInheritsPopupMenu', 'setInitialDelay', 'setInputMap', 'setInputVerifier', 'setLayout', 'setLegend', 'setLocale', 'setLocation', 'setMaximumDrawHeight', 'setMaximumDrawWidth', 'setMaximumSize', 'setMinimumDrawHeight', 'setMinimumDrawWidth', 'setMinimumSize', 'setMode', 'setMouseZoomable', 'setName', 'setNextFocusableComponent', 'setOpaque', 'setOrientation', 'setPlotBackground', 'setPlotProperties', 'setPopupMenu', 'setPreferredSize', 'setPropertiesLoading', 'setPropertyValue', 'setRangeZoomable', 'setRefreshBuffer', 'setRequestFocusEnabled', 'setReshowDelay', 'setSelectedData', 'setSelectedXValue', 'setSelectionEnabled', 'setSelectionHighlightColor', 'setSelectionHighlightWidth', 'setSeriesEnabled', 'setShowPopup', 'setSize', 'setSubplotMode', 'setTitle', 'setTitleFont', 'setToolTipText', 'setTooltips', 'setTransferHandler', 'setUI', 'setVerifyInputWhenFocusTarget', 'setVerticalAxisTrace', 'setVisible', 'setXAxes', 'setYAxes', 'setZoomAroundAnchor', 'setZoomInFactor', 'setZoomOutFactor', 'setZoomTriggerDistance', 'show', 'showPopup', 'showing', 'shutdownComponent', 'size', 'startupComponent', 'subplotMode', 'title', 'titleFont', 'toString', 'toolTipText', 'toolkit', 'tooltips', 'topLevelAncestor', 'transferFocus', 'transferFocusBackward', 'transferFocusDownCycle', 'transferFocusUpCycle', 'transferHandler', 'translateJava2DToScreen', 'translateScreenToJava2D', 'treeLock', 'unregisterKeyboardAction', 'update', 'updateQuality', 'updateUI', 'valid', 'validate', 'validateRoot', 'verifyInputWhenFocusTarget', 'verticalAxisTrace', 'vetoableChange', 'vetoableChangeListener', 'vetoableChangeListeners', 'visible', 'visibleRect', 'wait', 'width', 'x', 'y', 'zoom', 'zoomAroundAnchor', 'zoomInBoth', 'zoomInDomain', 'zoomInFactor', 'zoomInRange', 'zoomOutBoth', 'zoomOutDomain', 'zoomOutFactor', 'zoomOutRange', 'zoomTriggerDistance']

Unfortunately there isn’t really a good way to do this. I’d just leave the axis labels blank and add Label components next to each of the charts.