File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
viplab-standalone-frontend-vue/src/components/csv-plots Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -176,8 +176,15 @@ export default {
176
176
177
177
// set x-Axis label and title
178
178
// TODO: allow title in metadata? (id in dumux web-app)
179
- const lastIndex = this .csvs [this .fileIndex ].lastIndexOf (' /' );
180
- const title = ((this .areUrlsProp ) ? this .csvs [this .fileIndex ].substr (lastIndex + 1 , this .csvs [this .fileIndex ].length ) : ' Graph' );
179
+ let title = ' Graph' ;
180
+ if (this .areUrlsProp ) {
181
+ let startIndex = this .csvs [this .fileIndex ].lastIndexOf (' /' );
182
+ startIndex = (startIndex != - 1 ) ? startIndex : 0 ;
183
+ let endIndex = this .csvs [this .fileIndex ].lastIndexOf (' ?' );
184
+ endIndex = (endIndex != - 1 ) ? endIndex : this .csvs [this .fileIndex ].length ;
185
+ title = this .csvs [this .fileIndex ].substring (startIndex + 1 , endIndex);
186
+ }
187
+
181
188
const xformat = (this .labelProp .format ) ? this .labelProp .format : ' .1f' ;
182
189
const yformat = (this .datasetProp .format ) ? this .datasetProp .format : ' .1f' ;
183
190
const ytext = this .datasetProp .label || ((keys .length <= 2 ) ? keys[1 ] : ' ' );
You can’t perform that action at this time.
0 commit comments