Importing Data

Chartsmith provides several ways to import data from other sources. You can copy data from the source application and paste it into Chartsmith; send data to Chartsmith through Services; load data directly from ASCII data files; or import data from Excel.  You may also import data into Chartsmith via Applescript – see the Applescript documentation in the Chartsmith package to learn more about ChartsmithÕs Applescript interface.

Services

Chartsmith Services provide an easy way to import data from applications that provide ASCII data, including spreadsheets, word processors, and Mail. In the ASCII data, the columns must be delimited by tabs, commas, spaces, colons or semicolons; and the rows must be delimited by newline characters. Most applications use tabs for column delimiters and newlines for row delimiters.

To use Services, select the block of data in the source application. In the Services->Chartsmith menu, you will find a list of menu items that correspond to the chart types available in Chartsmith. Choose the menu item of the chart type you want to create. If Chartsmith is not already launched, it will launch, a new document will be opened and a new chart of the type you selected will be created. If Chartsmith is already running, and a document is open, then the new chart will be inserted into the active document after the currently selected chart. After the chart has been created the Data Import panel will appear, allowing you to select the data content and the column delimiter type. Once you have done so, the data is inserted into the Data View at the top, left cell and the chart is displayed.

Copy and Paste

Data can be copied and pasted from all applications that provide ASCII pasteboard data. See the ÒCopy And PasteÓ Help section in the ÒAbout ChartsmithÓ top-level section.

ASCII Files

Plain ASCII data files can be imported into Chartsmith's Data View. In the ASCII file, columns must be delimited by a single tab, comma, space, colon, or semicolon; and rows must be delimited by a single new line character. The file can contain just data values, data values and row labels, data values and series column labels, or data values and row and column labels.

Outlines for ASCII data formats are displayed below. Notice that a tab delimiter is assumed, and that the data content is 2 columns and 2 rows. (<tab> is a tab character; <\n> is a new line character)

Data values only:

data(1,1) <tab> data(1,2) <\n>
data(2,1) <tab> data(2,2)

Data values with row labels:

row1_label <tab> data(1,1) <tab> data(1,2) <\n>
row2_label <tab> data(2,1) <tab> data(2,2)

Data values with column labels:

col1_label <tab> col2_label <\n>
data(1,1) <tab> data(1,2) <\n>
data(2,1) <tab> data(2,2)

Data values with row and column labels:

<tab>
col1_label <tab> col2_label <\n>
row1_label <tab> data(1,1) <tab> data(1,2) <\n>
row2_label <tab> data(2,1) <tab> data(2,2)


ASCII files can be imported in two ways. The easiest way is to just drag the ASCII file from the Finder and drop it right into the Data View. The Import Data panel will appear, allowing you to select the data content and the column delimiter type. Once you have done so, the data is inserted into the Data View at the top, left cell and the chart is displayed. Any data in Data View when the ASCII file is dropped will be overwritten.

You can also import ASCII data files by choosing the Data_View->Import_ASCII_Data menu item. Select the file you want to import from the open panel, and then specify the Data Content and the Column Delimiter in the Import Data panel.

For CSV formatted files, choose the Comma column delimiter.

Importing from Excel

For importing from Excel, you can use Copy and Paste described above (i.e. copy from Excel, paste in Chartsmith), you can save from Excel as a CSV formatted data file then import that file as an ASCII file described above, or you can use the Import From Excel function, described here.

The Import From Excel menu item is found within the Data View menu.  When selected, a wizard is displayed on the Data View window.  This wizard can be used to select the Excel workbook (i.e. file), select the sheet or named range within the workbook and select the data cells within the sheet from which you would like to import data.

The first page of the wizard provides the option of selecting an Excel workbook that is already opened, or selecting a workbook from the file system.  All of the already-opened workbooks are listed in the popup near the radio button labeled ÒWorkbook already openedÓ, and a workbook not yet opened can be specified by selecting the ÒChoose WorkbookÓ button.  Make your choice then select ÒNextÓ. 

In addition to workbook selection, the first page has a switch labeled ÒHide ExcelÓ.  If selected, the Excel application will be hidden from view when the ÒNextÓ button is clicked.

Once a workbook has been specified, the next step is to indicate what cells in the workbook the data reside within.  This can be done in two ways.  The first is to specify a named region in the workbook, which designates the sheet and cells of interest.  The second is to specify a sheet within the workbook, then indicate what cells in that sheet should be imported. 

The second page of the import wizard provides two pop-ups from which you can chose a named range or sheet.  The sheets popup button lists the names of the sheets within the Excel workbook.  The named regions popup button lists any named regions that exist in the Excel workbook.  Make your choice, then select ÒNextÓ.

What is in the third page of the wizard will depend on your choice in the second page.  If you chose a named region, then the third page requests the contents of the data being imported.  Select whether you have only data, data with row labels, data with column labels, or data with row and column labels. Then click finish.

If you chose a sheet in the second page, then the third page of the wizard provides options for selecting the data that is within the specified sheet.  The first option specifies that all data within the sheet should be imported.  If there are blank cells within the range of cells that have data, the blank cells also will be imported.  The second option allows you to import only that data that is selected within the sheet.  You may bring Excel forward at this point to select data if you decide you want to use this option but have not yet selected the data.  The final option on this page allows you to type in a range of rows and columns from which the data will be imported (row and column indexes are numeric and begin at index 1).  Once you have specified the data to import, click ÒNextÓ.

The next page of the wizard, the final page, requests the contents of the data being imported.  Select whether you have only data, data with row labels, data with column labels, or data with row and column labels. 

On the final page of the wizard, clicking the ÒFinishÓ button will begin the process of importing data.  When all of the data has been imported, it will be loaded into the data view and the chart will be drawn.

Updating Imports from Excel

Once an import from Excel has been successfully executed, Update Import From Excel can be used to repeat the import. This feature essentially creates a hotlink between the data in Excel and the data in Chartsmith. Simply select the chart and use the menu item Update Import From Excel in the Data View Menu.

Update All Imports from Excel, also located in the Data View Menu executes an update on all Excel imports contained in the current Chartsmith document. This command causes Chartsmith to search the entire document for Excel imports, updating each one in turn.

Note: Both Update Excel imports commands depend on the name and location of the Excel file. If either of these change to the Update commands will no longer function.