Version: 1.6 beta 1 (using KDE KDE 3.5.4) Installed from: Gentoo Packages Compiler: gcc 4.1.1 OS: Linux I want to create a line graph from cells A1:M4 in attached file (data in rows). No matter what I do the data range remains blank in the chart dialog after pressing OK and opening it again.
Created an attachment (id=17802) [details] Spreadsheet with some data and attempt to create chart
Which version of kchart / kspread?
Oops, sorry. Missed the version info to the left.
Unfortunately I didn't have time to fix it before the release of 1.6.1 because there were other, more urgent, bugs to fix. This means you can't change the data range after the creation of the chart. On the other hand, it's not difficult to recreate the chart with a new data range if it's absolutely necessary. I will try to get this working before 1.6.2.
Just a note to be clear... I changed the title of this bug from "Impossible to create chart" to "Impossible to change the data range". Even though the data range in the dialog and wizard is empty, the chart will still be created correctly.
SVN commit 603079 by ingwa: Start on bug 134194: Impossible to change the data range. Step 1: Actually set and read the data area. CCBUG: 134194 M +11 -0 ChangeLog M +6 -0 kchartDataConfigPage.cc M +2 -2 kchartWizard.cc M +1 -1 kchartWizard.h M +6 -0 kchartWizardSelectDataFormatPage.cc M +8 -0 kchart_params.h M +2 -2 kchart_part.cc M +3 -3 kchart_part.h --- branches/koffice/1.6/koffice/kchart/ChangeLog #603078:603079 @@ -1,3 +1,14 @@ +2006-11-07 Inge Wallin <inge@lysator.liu.se> + + Start on bug 134194: Impossible to change the data range. + Step 1: Actually set and read the data area. + * kchart_params.h: store the data area in the params. + * kchartDataConfigPage.cc (init): Set dataArea lineEdit. + (defaults): clear it + (apply): set dataArea from the lineEdit + * kchartWizardSelectDataFormatPage.cc (constructor): set dataArea lineEdit + (apply): set dataArea from the lineEdit + 2006-11-06 Inge Wallin <inge@lysator.liu.se> Fix bug 128758: misinterpretation of the checkbox "first row as label" --- branches/koffice/1.6/koffice/kchart/kchartDataConfigPage.cc #603078:603079 @@ -111,6 +111,8 @@ if ( !m_params->part()->canChangeValue() ) { m_firstRowAsLabel->setChecked( m_params->firstRowAsLabel() ); m_firstColAsLabel->setChecked( m_params->firstColAsLabel() ); + + m_dataArea->setText( m_params->dataArea() ); } } @@ -122,6 +124,8 @@ if ( !m_params->part()->canChangeValue() ) { m_firstRowAsLabel->setChecked( false ); m_firstColAsLabel->setChecked( false ); + + m_dataArea->setText( "" ); } } @@ -136,6 +140,8 @@ if ( !m_params->part()->canChangeValue() ) { m_params->setFirstRowAsLabel( m_firstRowAsLabel->isChecked() ); m_params->setFirstColAsLabel( m_firstColAsLabel->isChecked() ); + + m_params->setDataArea( m_dataArea->text() ); } } --- branches/koffice/1.6/koffice/kchart/kchartWizard.cc #603078:603079 @@ -147,9 +147,9 @@ QWizard::reject(); } -void KChartWizard::setDataArea( const QString &area ) +void KChartWizard::setDataArea( const QString &dataArea ) { - m_dataFormatPage->setDataArea( area ); + m_dataFormatPage->setDataArea( dataArea ); } --- branches/koffice/1.6/koffice/kchart/kchartWizard.h #603078:603079 @@ -28,7 +28,7 @@ KChartPart* chart() const { return m_chart; }; // Set and get the string for the data area. - void setDataArea( const QString &area ); + void setDataArea( const QString &dataArea ); QString dataArea() const; enum RowCol { Row, Col }; --- branches/koffice/1.6/koffice/kchart/kchartWizardSelectDataFormatPage.cc #603078:603079 @@ -72,10 +72,13 @@ grid1->activate(); + // Enter the data into the widgets. if ( m_chart->params()->dataDirection() == KChartParams::DataColumns) m_colMajor->setChecked(true); else m_rowMajor->setChecked(true); + + m_dataArea->setText( m_chart->params()->dataArea() ); } @@ -99,6 +102,9 @@ m_chart->params()->setFirstRowAsLabel( m_firstRowAsLabel->isChecked() ); m_chart->params()->setFirstColAsLabel( m_firstColAsLabel->isChecked() ); + + m_chart->params()->setDataArea( m_dataArea->text() ); + // FIXME: Actually take use the new data area. } --- branches/koffice/1.6/koffice/kchart/kchart_params.h #603078:603079 @@ -90,7 +90,13 @@ bool firstColAsLabel() const { return m_firstColAsLabel; } void setFirstColAsLabel( bool _val ); + // Data area + QString dataArea() const { return m_dataArea; } + void setDataArea( QString dataArea ) { + m_dataArea = dataArea; + } + // ---------------------------------------------------------------- // BAR CHART EXTENSIONS TO SUPPORT OPENDOCUMENT @@ -145,6 +151,8 @@ bool m_firstRowAsLabel; bool m_firstColAsLabel; + QString m_dataArea; + // Extensions to support OpenDocument int m_barNumLines; // Number of lines in a bar chart. --- branches/koffice/1.6/koffice/kchart/kchart_part.cc #603078:603079 @@ -689,13 +689,13 @@ } -bool KChartPart::showWizard( QString &area ) +bool KChartPart::showWizard( QString &dataArea ) { KChartWizard *wizard = new KChartWizard( this, m_parentWidget, "wizard" ); connect( wizard, SIGNAL(finished()), this, SLOT(slotModified()) ); - wizard->setDataArea( area ); + wizard->setDataArea( dataArea ); bool ret = wizard->exec(); --- branches/koffice/1.6/koffice/kchart/kchart_part.h #603078:603079 @@ -53,7 +53,7 @@ bool firstRowHeader, bool firstRowHeader ); - bool showWizard( QString &area ); + bool showWizard( QString &dataArea ); void initLabelAndLegend(); void loadConfig(KConfig *conf); void saveConfig(KConfig *conf); @@ -142,8 +142,8 @@ WizardExt( KoChart::Part *part ) : KoChart::WizardExtension( part ) {}; - virtual bool show( QString &area ) { - return static_cast<KChartPart *>( part() )->showWizard( area ); + virtual bool show( QString &dataArea ) { + return static_cast<KChartPart *>( part() )->showWizard( dataArea ); } };
You need to log in before you can comment on or make changes to this bug.