Class EmbeddedLineChartBuilder

EmbeddedLineChartBuilder

लाइन चार्ट बनाने वाला टूल. ज़्यादा जानकारी के लिए, Gviz का दस्तावेज़ देखें.

तरीके

तरीकारिटर्न टाइपसंक्षिप्त विवरण
addRange(range)EmbeddedChartBuilderइस बिल्डर से बदले गए चार्ट में एक रेंज जोड़ता है.
asAreaChart()EmbeddedAreaChartBuilderयह फ़ंक्शन, चार्ट टाइप को AreaChart पर सेट करता है और EmbeddedAreaChartBuilder दिखाता है.
asBarChart()EmbeddedBarChartBuilderयह चार्ट टाइप को BarChart पर सेट करता है और EmbeddedBarChartBuilder दिखाता है.
asColumnChart()EmbeddedColumnChartBuilderयह चार्ट टाइप को ColumnChart पर सेट करता है और EmbeddedColumnChartBuilder दिखाता है.
asComboChart()EmbeddedComboChartBuilderयह चार्ट टाइप को ComboChart पर सेट करता है और EmbeddedComboChartBuilder दिखाता है.
asHistogramChart()EmbeddedHistogramChartBuilderयह फ़ंक्शन, चार्ट टाइप को HistogramChart पर सेट करता है और EmbeddedHistogramChartBuilder दिखाता है.
asLineChart()EmbeddedLineChartBuilderयह चार्ट टाइप को LineChart पर सेट करता है और EmbeddedLineChartBuilder दिखाता है.
asPieChart()EmbeddedPieChartBuilderयह चार्ट टाइप को PieChart पर सेट करता है और EmbeddedPieChartBuilder दिखाता है.
asScatterChart()EmbeddedScatterChartBuilderयह चार्ट टाइप को ScatterChart पर सेट करता है और EmbeddedScatterChartBuilder दिखाता है.
asTableChart()EmbeddedTableChartBuilderयह चार्ट टाइप को TableChart पर सेट करता है और EmbeddedTableChartBuilder दिखाता है.
build()EmbeddedChartचार्ट में किए गए सभी बदलावों को दिखाने के लिए, चार्ट बनाता है.
clearRanges()EmbeddedChartBuilderइस बिल्डर से बदले गए चार्ट से सभी रेंज हटाता है.
getChartType()ChartTypeमौजूदा चार्ट टाइप दिखाता है.
getContainer()ContainerInfoचार्ट ContainerInfo दिखाता है. इससे पता चलता है कि चार्ट, शीट में कहां दिखता है.
getRanges()Range[]यह फ़ंक्शन, उन रेंज की सूची की कॉपी दिखाता है जो फ़िलहाल इस चार्ट के लिए डेटा उपलब्ध करा रही हैं.
removeRange(range)EmbeddedChartBuilderयह फ़ंक्शन, उस चार्ट से तय की गई रेंज को हटाता है जिसे यह बिल्डर बदलता है.
reverseCategories()EmbeddedLineChartBuilderइससे डोमेन ऐक्सिस में सीरीज़ को उलटे क्रम में दिखाया जाता है.
setBackgroundColor(cssValue)EmbeddedLineChartBuilderइस विकल्प से, चार्ट के बैकग्राउंड का रंग सेट किया जाता है.
setChartType(type)EmbeddedChartBuilderइस विकल्प से चार्ट का टाइप बदला जाता है.
setColors(cssValues)EmbeddedLineChartBuilderइस विकल्प का इस्तेमाल करके, चार्ट में मौजूद लाइनों के रंग सेट किए जाते हैं.
setCurveStyle(style)EmbeddedLineChartBuilderयह विकल्प, चार्ट में कर्व के लिए इस्तेमाल की जाने वाली स्टाइल सेट करता है.
setHiddenDimensionStrategy(strategy)EmbeddedChartBuilderछुपाई गई लाइनों और कॉलम के लिए इस्तेमाल की जाने वाली रणनीति सेट करता है.
setLegendPosition(position)EmbeddedLineChartBuilderइस विकल्प की मदद से, चार्ट के हिसाब से लेजेंड की पोज़िशन सेट की जाती है.
setLegendTextStyle(textStyle)EmbeddedLineChartBuilderइससे चार्ट लेजेंड के टेक्स्ट की स्टाइल सेट की जाती है.
setMergeStrategy(mergeStrategy)EmbeddedChartBuilderएक से ज़्यादा रेंज मौजूद होने पर, मर्ज करने की रणनीति सेट करता है.
setNumHeaders(headers)EmbeddedChartBuilderयह विकल्प, रेंज की उन पंक्तियों या कॉलम की संख्या सेट करता है जिन्हें हेडर के तौर पर इस्तेमाल किया जाना चाहिए.
setOption(option, value)EmbeddedChartBuilderइस चार्ट के लिए बेहतर विकल्प सेट करता है.
setPointStyle(style)EmbeddedLineChartBuilderलाइन में मौजूद पॉइंट के लिए स्टाइल सेट करता है.
setPosition(anchorRowPos, anchorColPos, offsetX, offsetY)EmbeddedChartBuilderइस विकल्प से, चार्ट की जगह सेट की जाती है. इससे यह तय होता है कि चार्ट, शीट में कहां दिखेगा.
setRange(start, end)EmbeddedLineChartBuilderइस विकल्प से, चार्ट के लिए रेंज सेट की जाती है.
setTitle(chartTitle)EmbeddedLineChartBuilderइससे चार्ट का टाइटल सेट किया जाता है.
setTitleTextStyle(textStyle)EmbeddedLineChartBuilderइस विकल्प से, चार्ट के टाइटल की टेक्स्ट स्टाइल सेट की जाती है.
setTransposeRowsAndColumns(transpose)EmbeddedChartBuilderइससे यह तय किया जाता है कि चार्ट की पंक्तियों और कॉलम की अदला-बदली की जाए या नहीं.
setXAxisTextStyle(textStyle)EmbeddedLineChartBuilderइस विकल्प से, हॉरिज़ॉन्टल ऐक्सिस के टेक्स्ट की स्टाइल सेट की जाती है.
setXAxisTitle(title)EmbeddedLineChartBuilderइससे हॉरिज़ॉन्टल ऐक्सिस में टाइटल जोड़ा जाता है.
setXAxisTitleTextStyle(textStyle)EmbeddedLineChartBuilderइससे हॉरिज़ॉन्टल ऐक्सिस के टाइटल टेक्स्ट की स्टाइल सेट की जाती है.
setYAxisTextStyle(textStyle)EmbeddedLineChartBuilderइस विकल्प से, वर्टिकल ऐक्सिस के टेक्स्ट की स्टाइल सेट की जाती है.
setYAxisTitle(title)EmbeddedLineChartBuilderवर्टिकल ऐक्सिस में टाइटल जोड़ता है.
setYAxisTitleTextStyle(textStyle)EmbeddedLineChartBuilderइससे वर्टिकल ऐक्सिस के टाइटल के टेक्स्ट की स्टाइल सेट की जाती है.
useLogScale()EmbeddedLineChartBuilderइस विकल्प से, रेंज ऐक्सिस को लॉगरिद्मिक स्केल में बदला जाता है. इसके लिए, सभी वैल्यू पॉज़िटिव होनी चाहिए.

ज़्यादा जानकारी वाला दस्तावेज़

addRange(range)

इस बिल्डर से बदले गए चार्ट में एक रेंज जोड़ता है. अगर रेंज को पहले ही चार्ट में जोड़ दिया गया है, तो उसे दोबारा नहीं जोड़ा जाता.

const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0];  const chart = sheet.newChart()                   .setChartType(Charts.ChartType.BAR)                   .addRange(sheet.getRange('A1:B8'))                   .setPosition(5, 5, 0, 0)                   .build();  sheet.insertChart(chart);

पैरामीटर

नामटाइपब्यौरा
rangeRangeजोड़ी जाने वाली रेंज.

वापसी का टिकट

EmbeddedChartBuilder — यह बिल्डर, चेनिंग के लिए है.


asAreaChart()

यह फ़ंक्शन, चार्ट टाइप को AreaChart पर सेट करता है और EmbeddedAreaChartBuilder दिखाता है.

वापसी का टिकट

EmbeddedAreaChartBuilder — यह एरिया चार्ट बनाने वाला टूल है.


asBarChart()

यह चार्ट टाइप को BarChart पर सेट करता है और EmbeddedBarChartBuilder दिखाता है.

वापसी का टिकट

EmbeddedBarChartBuilder — बार चार्ट बनाने वाला बिल्डर.


asColumnChart()

यह चार्ट टाइप को ColumnChart पर सेट करता है और EmbeddedColumnChartBuilder दिखाता है.

वापसी का टिकट

EmbeddedColumnChartBuilder — यह कॉलम चार्ट बनाने वाला बिल्डर है.


asComboChart()

यह चार्ट टाइप को ComboChart पर सेट करता है और EmbeddedComboChartBuilder दिखाता है.

वापसी का टिकट

EmbeddedComboChartBuilder — यह कॉम्बो चार्ट बनाने वाला टूल है.


asHistogramChart()

यह फ़ंक्शन, चार्ट टाइप को HistogramChart पर सेट करता है और EmbeddedHistogramChartBuilder दिखाता है.

वापसी का टिकट

EmbeddedHistogramChartBuilder — यह हिस्टोग्राम चार्ट बनाने वाला बिल्डर है.


asLineChart()

यह चार्ट टाइप को LineChart पर सेट करता है और EmbeddedLineChartBuilder दिखाता है.

वापसी का टिकट

EmbeddedLineChartBuilder — यह लाइन चार्ट बनाने वाला टूल है.


asPieChart()

यह चार्ट टाइप को PieChart पर सेट करता है और EmbeddedPieChartBuilder दिखाता है.

वापसी का टिकट

EmbeddedPieChartBuilder — यह पाई चार्ट बनाने वाला टूल है.


asScatterChart()

यह चार्ट टाइप को ScatterChart पर सेट करता है और EmbeddedScatterChartBuilder दिखाता है.

वापसी का टिकट

EmbeddedScatterChartBuilder — स्कैटर चार्ट बनाने वाला बिल्डर.


asTableChart()

यह चार्ट टाइप को TableChart पर सेट करता है और EmbeddedTableChartBuilder दिखाता है.

वापसी का टिकट

EmbeddedTableChartBuilder — यह टेबल चार्ट बनाने वाला बिल्डर है.


build()

चार्ट में किए गए सभी बदलावों को दिखाने के लिए, चार्ट बनाता है.

इस तरीके से, स्प्रेडशीट के ऊपर चार्ट अपने-आप नहीं बनता है. sheet.insertChart(chart) की मदद से नया चार्ट डाला जाना चाहिए. साथ ही, sheet.updateChart(chart) की मदद से मौजूदा चार्ट को अपडेट किया जाना चाहिए.

const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0];  const range = sheet.getRange('A1:B5'); const chart = sheet.newChart()                   .setChartType(Charts.ChartType.BAR)                   .addRange(range)                   .setPosition(5, 5, 0, 0)                   .build();  sheet.insertChart(chart);

वापसी का टिकट

EmbeddedChart — बनाया गया चार्ट, जिसे अब भी स्प्रेडशीट में जोड़ना होगा.


clearRanges()

इस बिल्डर से बदले गए चार्ट से सभी रेंज हटाता है.

const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0];  // This code updates the chart to use only the new ranges while preserving the // existing formatting of the chart. const chart = sheet.getCharts()[0]; const newChart = chart.modify()                      .clearRanges()                      .addRange(sheet.getRange('A1:A5'))                      .addRange(sheet.getRange('B1:B5'))                      .build(); sheet.updateChart(newChart);

वापसी का टिकट

EmbeddedChartBuilder — यह बिल्डर, चेनिंग के लिए है.


getChartType()

मौजूदा चार्ट टाइप दिखाता है.

वापसी का टिकट

ChartType — चार्ट का टाइप.


getContainer()

चार्ट ContainerInfo दिखाता है. इससे पता चलता है कि चार्ट, शीट में कहां दिखता है.

const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0];  const chartBuilder = sheet.newChart()                          .setChartType(Charts.ChartType.BAR)                          .addRange(sheet.getRange('A1:B8'))                          .setPosition(5, 5, 0, 0);  // This method returns the exact same data as Chart#getContainerInfo() const containerInfo = chartBuilder.getContainer();  // Logs the values used in setPosition() Logger.log(     'Anchor Column: %s\r\nAnchor Row %s\r\nOffset X %s\r\nOffset Y %s',     containerInfo.getAnchorColumn(),     containerInfo.getAnchorRow(),     containerInfo.getOffsetX(),     containerInfo.getOffsetY(), );

वापसी का टिकट

ContainerInfo — यह एक ऐसा ऑब्जेक्ट होता है जिसमें चार्ट कंटेनर की पोज़िशन शामिल होती है.


getRanges()

यह फ़ंक्शन, उन रेंज की सूची की कॉपी दिखाता है जो फ़िलहाल इस चार्ट के लिए डेटा उपलब्ध करा रही हैं. इस सूची में बदलाव करने के लिए, addRange(range) और removeRange(range) का इस्तेमाल करें.

const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0];  const chartBuilder = sheet.newChart()                          .setChartType(Charts.ChartType.BAR)                          .addRange(sheet.getRange('A1:B8'))                          .setPosition(5, 5, 0, 0);  const ranges = chartBuilder.getRanges();  // There's only one range as a data source for this chart, // so this logs "A1:B8" for (const i in ranges) {   const range = ranges[i];   Logger.log(range.getA1Notation()); }

वापसी का टिकट

Range[] — यह रेंज का एक ऐसा कलेक्शन होता है जो चार्ट बनाने के लिए डेटा सोर्स के तौर पर काम करता है.


removeRange(range)

यह फ़ंक्शन, उस चार्ट से तय की गई रेंज को हटाता है जिसे यह बिल्डर बदलता है. अगर रेंज इस चार्ट में नहीं है, तो गड़बड़ी नहीं दिखाता है.

हटाए गए डेटा की रेंज, addRange(range) के ज़रिए जोड़े गए डेटा की रेंज से मेल खानी चाहिए. ऐसा न होने पर, चार्ट में कोई बदलाव नहीं किया जाता. इस तरीके का इस्तेमाल, किसी रेंज से वैल्यू को पूरी तरह से हटाने के लिए नहीं किया जा सकता.

const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0];  const firstRange = sheet.getRange('A1:B5'); const secondRange = sheet.getRange('A6:B8');  const chartBuilder = sheet.newChart()                          .setChartType(Charts.ChartType.BAR)                          .addRange(firstRange)                          // This range renders in a different color                          .addRange(secondRange)                          .setPosition(5, 5, 0, 0);  // Note that you can use either of these two formats, but the range // MUST match up with a range that was added via addRange(), or it // is not removed, and does not throw an exception chartBuilder.removeRange(firstRange); chartBuilder.removeRange(sheet.getRange('A6:B8'));  const chart = chartBuilder.build();  sheet.insertChart(chart);

पैरामीटर

नामटाइपब्यौरा
rangeRangeहटाने के लिए रेंज.

वापसी का टिकट

EmbeddedChartBuilder — यह बिल्डर, चेनिंग के लिए है.


reverseCategories()

इससे डोमेन ऐक्सिस में सीरीज़ को उलटे क्रम में दिखाया जाता है. वर्टिकल-रेंज चार्ट (जैसे कि लाइन, एरिया या कॉलम चार्ट) के लिए, इसका मतलब है कि हॉरिज़ॉन्टल ऐक्सिस को दाईं से बाईं ओर बनाया जाता है. हॉरिज़ॉन्टल-रेंज चार्ट (जैसे कि बार चार्ट) के लिए, इसका मतलब है कि वर्टिकल ऐक्सिस को ऊपर से नीचे की ओर बनाया जाता है. पाई चार्ट के लिए, इसका मतलब है कि स्लाइस को घड़ी की उलटी दिशा में बनाया गया है.

// Creates a pie chart builder and sets drawing of the slices in a // counter-clockwise manner. const builder = Charts.newPieChart(); builder.reverseCategories();

वापसी का टिकट

EmbeddedLineChartBuilder — यह बिल्डर, चेन बनाने के लिए काम का है.


setBackgroundColor(cssValue)

इस विकल्प से, चार्ट के बैकग्राउंड का रंग सेट किया जाता है.

// Creates a line chart builder and sets the background color to gray const builder = Charts.newLineChart(); builder.setBackgroundColor('gray');

पैरामीटर

नामटाइपब्यौरा
cssValueStringरंग के लिए सीएसएस वैल्यू (जैसे, "blue" या "#00f").

वापसी का टिकट

EmbeddedLineChartBuilder — यह बिल्डर, चेन बनाने के लिए काम का है.


setChartType(type)

इस विकल्प से चार्ट का टाइप बदला जाता है. फ़िलहाल, सभी तरह के एम्बेड किए गए चार्ट काम नहीं करते. ChartType देखें.

const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0];  const range = sheet.getRange('A1:B5'); const chart = sheet.newChart()                   .setChartType(Charts.ChartType.BAR)                   .addRange(range)                   .setPosition(5, 5, 0, 0)                   .build();  sheet.insertChart(chart);

पैरामीटर

नामटाइपब्यौरा
typeChartTypeचार्ट को जिस टाइप में बदलना है.

वापसी का टिकट

EmbeddedChartBuilder — यह बिल्डर, चेनिंग के लिए है.


setColors(cssValues)

इस विकल्प का इस्तेमाल करके, चार्ट में मौजूद लाइनों के रंग सेट किए जाते हैं.

// Creates a line chart builder and sets the first two lines to be drawn in // green and red, respectively. const builder = Charts.newLineChart(); builder.setColors(['green', 'red']);

पैरामीटर

नामटाइपब्यौरा
cssValuesString[]कलर सीएसएस वैल्यू का एक कलेक्शन, जैसे कि ["red", "#acf"]. ऐरे में मौजूद nवां एलिमेंट, चार्ट में मौजूद nवीं लाइन के रंग को दिखाता है.

वापसी का टिकट

EmbeddedLineChartBuilder — यह बिल्डर, चेन बनाने के लिए काम का है.


setCurveStyle(style)

यह विकल्प, चार्ट में कर्व के लिए इस्तेमाल की जाने वाली स्टाइल सेट करता है. अनुमति वाले कर्व स्टाइल के लिए, CurveStyle देखें.

// Creates a line chart builder and curves the lines in the chart. const builder = Charts.newLineChart(); builder.setCurveStyle(Charts.CurveStyle.SMOOTH);

पैरामीटर

नामटाइपब्यौरा
styleCurveStyleचार्ट में मौजूद कर्व की स्टाइल.

वापसी का टिकट

EmbeddedLineChartBuilder — यह बिल्डर, चेन बनाने के लिए काम का है.

इन्हें भी देखें


setHiddenDimensionStrategy(strategy)

छुपाई गई लाइनों और कॉलम के लिए इस्तेमाल की जाने वाली रणनीति सेट करता है. डिफ़ॉल्ट रूप से, यह IGNORE_ROWS पर सेट होती है.

const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0];  const range = sheet.getRange('A1:B5'); const chart = sheet.newChart()                   .setChartType(Charts.ChartType.BAR)                   .addRange(range)                   .setHiddenDimensionStrategy(                       Charts.ChartHiddenDimensionStrategy.IGNORE_COLUMNS,                       )                   .setPosition(5, 5, 0, 0)                   .build();  sheet.insertChart(chart);

पैरामीटर

नामटाइपब्यौरा
strategyChartHiddenDimensionStrategyछुपी हुई लाइनों और कॉलम के लिए इस्तेमाल की जाने वाली रणनीति.

वापसी का टिकट

EmbeddedChartBuilder — यह बिल्डर, चेनिंग के लिए है.


setLegendPosition(position)

इस विकल्प की मदद से, चार्ट के हिसाब से लेजेंड की पोज़िशन सेट की जाती है. डिफ़ॉल्ट रूप से, कोई लेजेंड नहीं होता है.

// Creates a line chart builder and sets the legend position to right. const builder = Charts.newLineChart(); builder.setLegendPosition(Charts.Position.RIGHT);

पैरामीटर

नामटाइपब्यौरा
positionPositionलेजेंड की पोज़िशन.

वापसी का टिकट

EmbeddedLineChartBuilder — यह बिल्डर, चेन बनाने के लिए काम का है.


setLegendTextStyle(textStyle)

इससे चार्ट लेजेंड के टेक्स्ट की स्टाइल सेट की जाती है.

// Creates a line chart builder and sets it up for a  blue, 26-point legend. const textStyleBuilder =     Charts.newTextStyle().setColor('#0000FF').setFontSize(26); const style = textStyleBuilder.build(); const builder = Charts.newLineChart(); builder.setLegendTextStyle(style);

पैरामीटर

नामटाइपब्यौरा
textStyleTextStyleचार्ट के लेजेंड के लिए इस्तेमाल की जाने वाली टेक्स्ट स्टाइल.

वापसी का टिकट

EmbeddedLineChartBuilder — यह बिल्डर, चेन बनाने के लिए काम का है.


setMergeStrategy(mergeStrategy)

एक से ज़्यादा रेंज मौजूद होने पर, मर्ज करने की रणनीति सेट करता है. अगर MERGE_ROWS है, तो पंक्तियां मर्ज की जाती हैं. अगर MERGE_COLUMNS है, तो कॉलम मर्ज किए जाते हैं. डिफ़ॉल्ट रूप से, यह MERGE_COLUMNS पर सेट होती है.

const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0];  const range = sheet.getRange('A1:B10'); const range2 = sheet.getRange('C:C10'); const chart = sheet.newChart()                   .setChartType(Charts.ChartType.BAR)                   .addRange(range)                   .addRange(range2)                   .setMergeStrategy(Charts.ChartMergeStrategy.MERGE_ROWS)                   .setPosition(5, 5, 0, 0)                   .build();  sheet.insertChart(chart);

पैरामीटर

नामटाइपब्यौरा
mergeStrategyChartMergeStrategyमर्ज करने के लिए इस्तेमाल की जाने वाली रणनीति.

वापसी का टिकट

EmbeddedChartBuilder — यह बिल्डर, चेनिंग के लिए है.


setNumHeaders(headers)

यह विकल्प, रेंज की उन पंक्तियों या कॉलम की संख्या सेट करता है जिन्हें हेडर के तौर पर इस्तेमाल किया जाना चाहिए.

const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0];  const range = sheet.getRange('A1:B5'); const chart = sheet.newChart()                   .setChartType(Charts.ChartType.BAR)                   .addRange(range)                   .setNumHeaders(1)                   .setPosition(5, 5, 0, 0)                   .build();  sheet.insertChart(chart);

पैरामीटर

नामटाइपब्यौरा
headersIntegerहेडर के तौर पर इस्तेमाल की जाने वाली पंक्तियों या कॉलम की संख्या. नेगेटिव वैल्यू की वजह से, हेडर अपने-आप पहचान लिए जाते हैं.

वापसी का टिकट

EmbeddedChartBuilder — यह बिल्डर, चेनिंग के लिए है.


setOption(option, value)

इस चार्ट के लिए बेहतर विकल्प सेट करता है. उपलब्ध विकल्पों की सूची देखने के लिए, चार्ट कॉन्फ़िगरेशन के विकल्प देखें.

इस तरीके से यह पुष्टि नहीं की जाती कि आपने जो विकल्प दिया है वह इस चार्ट टाइप के लिए मान्य है या नहीं. साथ ही, यह भी पुष्टि नहीं की जाती कि वैल्यू सही फ़ॉर्मैट/स्ट्रक्चर में है या नहीं.

इस उदाहरण में, टाइटल बदलने और लेजेंड सेट करने का तरीका बताया गया है.

const spreadsheet = SpreadsheetApp.getActiveSpreadsheet(); const sheet = spreadsheet.getSheets()[0]; const chart = sheet.newChart()  .setOption('title', 'Earnings projections')  .setOption('legend', {    position: 'top',    textStyle: { color: 'blue', fontSize: 16 },  }).build();

पैरामीटर

नामटाइपब्यौरा
optionStringविकल्प का नाम.
valueObjectविकल्प की वैल्यू.

वापसी का टिकट

EmbeddedChartBuilder — यह बिल्डर, चेनिंग के लिए है.


setPointStyle(style)

लाइन में मौजूद पॉइंट के लिए स्टाइल सेट करता है. डिफ़ॉल्ट रूप से, पॉइंट की कोई स्टाइल नहीं होती है. सिर्फ़ लाइन दिखती है.

// Creates a line chart builder and sets large point style. const builder = Charts.newLineChart(); builder.setPointStyle(Charts.PointStyle.LARGE);

पैरामीटर

नामटाइपब्यौरा
stylePointStyleलाइन में मौजूद पॉइंट के लिए इस्तेमाल की जाने वाली स्टाइल.

वापसी का टिकट

EmbeddedLineChartBuilder — यह बिल्डर, चेन बनाने के लिए काम का है.

इन्हें भी देखें


setPosition(anchorRowPos, anchorColPos, offsetX, offsetY)

इस विकल्प से, चार्ट की जगह सेट की जाती है. इससे यह तय होता है कि चार्ट, शीट में कहां दिखेगा. anchorRowPos और anchorColPos, 1 से इंडेक्स किए गए हैं.

const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0];  const range = sheet.getRange('A1:B5'); const chart = sheet.newChart()                   .setChartType(Charts.ChartType.BAR)                   .addRange(range)                   .setPosition(5, 5, 0, 0)                   .build();  sheet.insertChart(chart);

पैरामीटर

नामटाइपब्यौरा
anchorRowPosIntegerचार्ट का ऊपरी हिस्सा इस लाइन में ऐंकर किया गया है.
anchorColPosIntegerचार्ट का बायां हिस्सा इस कॉलम में ऐंकर किया गया है.
offsetXIntegerचार्ट का ऊपर दायां कोना, इतने पिक्सल से ऑफ़सेट होता है.
offsetYIntegerचार्ट का सबसे नीचे बायां कोना, इतने पिक्सल से ऑफ़सेट होता है.

वापसी का टिकट

EmbeddedChartBuilder — यह बिल्डर, चेनिंग के लिए है.


setRange(start, end)

इस विकल्प से, चार्ट के लिए रेंज सेट की जाती है.

अगर कोई डेटा पॉइंट रेंज से बाहर है, तो उस डेटा पॉइंट को शामिल करने के लिए रेंज को बड़ा किया जाता है.

पैरामीटर

नामटाइपब्यौरा
startNumberयह रेंज ऐक्सिस की सबसे निचली ग्रिड लाइन की वैल्यू होती है.
endNumberरेंज ऐक्सिस की सबसे ऊपर वाली ग्रिड लाइन की वैल्यू.

वापसी का टिकट

EmbeddedLineChartBuilder — यह बिल्डर, चेन बनाने के लिए काम का है.


setTitle(chartTitle)

इससे चार्ट का टाइटल सेट किया जाता है. टाइटल, चार्ट के ऊपर बीच में दिखता है.

// Creates a line chart builder and title to 'My Line Chart'. const builder = Charts.newLineChart(); builder.setTitle('My Line Chart');

पैरामीटर

नामटाइपब्यौरा
chartTitleStringचार्ट का टाइटल.

वापसी का टिकट

EmbeddedLineChartBuilder — यह बिल्डर, चेन बनाने के लिए काम का है.


setTitleTextStyle(textStyle)

इस विकल्प से, चार्ट के टाइटल की टेक्स्ट स्टाइल सेट की जाती है.

// Creates a line chart builder and sets it up for a  blue, 26-point title. const textStyleBuilder =     Charts.newTextStyle().setColor('#0000FF').setFontSize(26); const style = textStyleBuilder.build(); const builder = Charts.newLineChart(); builder.setTitleTextStyle(style);

पैरामीटर

नामटाइपब्यौरा
textStyleTextStyleचार्ट के टाइटल के लिए इस्तेमाल की जाने वाली टेक्स्ट स्टाइल. TextStyleBuilder को कॉल करके, TextStyleBuilder ऑब्जेक्ट बनाया जा सकता है.Charts.newTextStyle()

वापसी का टिकट

EmbeddedLineChartBuilder — यह बिल्डर, चेन बनाने के लिए काम का है.


setTransposeRowsAndColumns(transpose)

इससे यह तय किया जाता है कि चार्ट की पंक्तियों और कॉलम की अदला-बदली की जाए या नहीं. अगर इसे true पर सेट किया जाता है, तो पंक्तियों और कॉलम की अदला-बदली हो जाती है. डिफ़ॉल्ट रूप से, यह false पर सेट होती है.

const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0];  const range = sheet.getRange('A1:B5'); const chart = sheet.newChart()                   .setChartType(Charts.ChartType.BAR)                   .addRange(range)                   .setTransposeRowsAndColumns(true)                   .setPosition(5, 5, 0, 0)                   .build();  sheet.insertChart(chart);

पैरामीटर

नामटाइपब्यौरा
transposeBooleanअगर true है, तो चार्ट बनाने के लिए इस्तेमाल की गई पंक्तियों और कॉलम को ट्रांसपोज़ किया जाता है.

वापसी का टिकट

EmbeddedChartBuilder — यह बिल्डर, चेनिंग के लिए है.


setXAxisTextStyle(textStyle)

इस विकल्प से, हॉरिज़ॉन्टल ऐक्सिस के टेक्स्ट की स्टाइल सेट की जाती है.

// Creates a line chart builder and sets the X-axis text style to blue, 18-point // font. const textStyle =     Charts.newTextStyle().setColor('blue').setFontSize(18).build(); const builder = Charts.newLineChart(); builder.setXAxisTextStyle(textStyle);

पैरामीटर

नामटाइपब्यौरा
textStyleTextStyleहॉरिज़ॉन्टल ऐक्सिस के टाइटल के लिए इस्तेमाल की जाने वाली टेक्स्ट स्टाइल. TextStyleBuilder को कॉल करके, TextStyleBuilder ऑब्जेक्ट बनाया जा सकता है.Charts.newTextStyle()

वापसी का टिकट

EmbeddedLineChartBuilder — यह बिल्डर, चेन बनाने के लिए काम का है.


setXAxisTitle(title)

इससे हॉरिज़ॉन्टल ऐक्सिस में टाइटल जोड़ा जाता है. टाइटल बीच में होता है और ऐक्सिस वैल्यू के लेबल के नीचे दिखता है.

// Creates a line chart builder and sets the X-axis title. const builder = Charts.newLineChart(); builder.setTitle('X-axis Title');

पैरामीटर

नामटाइपब्यौरा
titleStringX-ऐक्सिस का टाइटल.

वापसी का टिकट

EmbeddedLineChartBuilder — यह बिल्डर, चेन बनाने के लिए काम का है.


setXAxisTitleTextStyle(textStyle)

इससे हॉरिज़ॉन्टल ऐक्सिस के टाइटल टेक्स्ट की स्टाइल सेट की जाती है.

// Creates a line chart builder and sets the X-axis title text style to blue, // 18-point font. const textStyle =     Charts.newTextStyle().setColor('blue').setFontSize(18).build(); const builder = Charts.newLineChart(); builder.setXAxisTitleTextStyle(textStyle);

पैरामीटर

नामटाइपब्यौरा
textStyleTextStyleहॉरिज़ॉन्टल ऐक्सिस के टाइटल के लिए इस्तेमाल की जाने वाली टेक्स्ट स्टाइल. TextStyleBuilder को कॉल करके, TextStyleBuilder ऑब्जेक्ट बनाया जा सकता है.Charts.newTextStyle()

वापसी का टिकट

EmbeddedLineChartBuilder — यह बिल्डर, चेन बनाने के लिए काम का है.


setYAxisTextStyle(textStyle)

इस विकल्प से, वर्टिकल ऐक्सिस के टेक्स्ट की स्टाइल सेट की जाती है.

// Creates a line chart builder and sets the Y-axis text style to blue, 18-point // font. const textStyle =     Charts.newTextStyle().setColor('blue').setFontSize(18).build(); const builder = Charts.newLineChart(); builder.setYAxisTextStyle(textStyle);

पैरामीटर

नामटाइपब्यौरा
textStyleTextStyleहॉरिज़ॉन्टल ऐक्सिस के टाइटल के लिए इस्तेमाल की जाने वाली टेक्स्ट स्टाइल. TextStyleBuilder को कॉल करके, TextStyleBuilder ऑब्जेक्ट बनाया जा सकता है.Charts.newTextStyle()

वापसी का टिकट

EmbeddedLineChartBuilder — यह बिल्डर, चेन बनाने के लिए काम का है.


setYAxisTitle(title)

वर्टिकल ऐक्सिस में टाइटल जोड़ता है. टाइटल बीच में होता है और वैल्यू लेबल के बाईं ओर दिखता है.

// Creates a line chart builder and sets the Y-axis title. const builder = Charts.newLineChart(); builder.setYAxisTitle('Y-axis Title');

पैरामीटर

नामटाइपब्यौरा
titleStringY-ऐक्सिस का टाइटल.

वापसी का टिकट

EmbeddedLineChartBuilder — यह बिल्डर, चेन बनाने के लिए काम का है.


setYAxisTitleTextStyle(textStyle)

इससे वर्टिकल ऐक्सिस के टाइटल के टेक्स्ट की स्टाइल सेट की जाती है.

// Creates a line chart builder and sets the Y-axis title text style to blue, // 18-point font. const textStyle =     Charts.newTextStyle().setColor('blue').setFontSize(18).build(); const builder = Charts.newLineChart(); builder.setYAxisTitleTextStyle(textStyle);

पैरामीटर

नामटाइपब्यौरा
textStyleTextStyleहॉरिज़ॉन्टल ऐक्सिस के टाइटल के लिए इस्तेमाल की जाने वाली टेक्स्ट स्टाइल. TextStyleBuilder को कॉल करके, TextStyleBuilder ऑब्जेक्ट बनाया जा सकता है.Charts.newTextStyle()

वापसी का टिकट

EmbeddedLineChartBuilder — यह बिल्डर, चेन बनाने के लिए काम का है.


useLogScale()

इस विकल्प से, रेंज ऐक्सिस को लॉगरिद्मिक स्केल में बदला जाता है. इसके लिए, सभी वैल्यू पॉज़िटिव होनी चाहिए. रेंज ऐक्सिस, वर्टिकल चार्ट (जैसे कि लाइन, एरिया या कॉलम) के लिए वर्टिकल ऐक्सिस होता है. साथ ही, हॉरिज़ॉन्टल चार्ट (जैसे कि बार) के लिए हॉरिज़ॉन्टल ऐक्सिस होता है.

वापसी का टिकट

EmbeddedLineChartBuilder — यह बिल्डर, चेन बनाने के लिए काम का है.