In Jasper Reports, has anyone tried excluding bands during text export? - jasper-reports

I've tried using the following property, but can't get it to work.
<property name="net.sf.jasperreports.export.text.exclude.origin.band.1" value="title">
I had also used 'txt' instead of 'text' as pointed out here, but it didn't work either.
Following is a sample jrxml with the above property -
<?xml version = "1.0" encoding = "UTF-8"?>
<!DOCTYPE jasperReport PUBLIC "//JasperReports//DTD Report Design//EN"
"http://jasperreports.sourceforge.net/dtds/jasperreport.dtd">
<jasperReport xmlns = "http://jasperreports.sourceforge.net/jasperreports"
xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation = "http://jasperreports.sourceforge.net/jasperreports
http://jasperreports.sourceforge.net/xsd/jasperreport.xsd"
name = "jasper_report_template" language = "groovy" pageWidth = "595"
pageHeight = "842" columnWidth = "555" leftMargin = "20" rightMargin = "20"
topMargin = "20" bottomMargin = "20">
<property name="net.sf.jasperreports.export.text.exclude.origin.band.1" value="title"/>
<queryString>
<![CDATA[]]>
</queryString>
<title>
<band height = "23">
<staticText>
<reportElement mode = "Opaque" x = "0" y = "3" width = "535"
height = "15" />
<textElement />
<text><![CDATA[This is title band]]> </text>
</staticText>
</band>
</title>
<detail>
<band height = "16">
<staticText>
<reportElement mode = "Opaque" x = "0" y = "0" width = "535"
height = "14" backcolor = "#E5ECF9" />
<textElement />
<text><![CDATA[This is detail band]]> </text>
</staticText>
</band>
</detail>
</jasperReport>

Related

Pine Script V5 - Not getting expected breakout entry price and entry in expected bar

I have a long entry buy condition where
Candle time frame is 15 minutes
Alert candle high is below lower band of bollinger bands.
entry when next candle crossover the alert candle high
This script gives entry oh high breakout + 0.01 but it does not give entry in the exact breakout candle and gives entry when price comes next time on expected entry price i.e. alert candle high + 0.01.
Requesting solution to get entry in breakout candle itself and at expected breakout price.
//#version=5
strategy("Bands Reversion", overlay=true, calc_on_every_tick=true)
//// Indicator Bollinger Bands
source = close
length = input.int(20, minval=1)
mult = input.float(1.5, minval=0.001, maxval=50)
direction = input.int(0, title = "Strategy Direction", minval=-1, maxval=1)
strategy.risk.allow_entry_in(direction == 0 ? strategy.direction.all : (direction < 0 ? strategy.direction.short : strategy.direction.long))
basis = ta.sma(source, length)
dev = mult * ta.stdev(source, length)
upper = basis + dev
lower = basis - dev
plot(basis, color = color.red)
plot(upper)
plot(lower)
/// Trade entry time and squareoff time
TradeTime = input(title="Trade Timings",defval="0930-1130")
SqoffTime = input(title="Squareoff Timings",defval="1530-1545")
Barsinsession(TradeTime) => time(timeframe.period,TradeTime) != 0
Insession = Barsinsession(TradeTime) ? 1 : 0
endofsession = Insession == 0 and Insession[1] == 1
Sqsession = Barsinsession(SqoffTime) ? 1 : 0
SqTime = Sqsession == 1 and Sqsession[1] == 0
//// Input control and conditions
buy_condition = high[1] < lower[1] and ta.crossover(high, high[1]) and Insession
short_condition = low[1] > upper[1] and ta.crossunder(low, low[1]) and Insession
buy_alert_high = ta.valuewhen(buy_condition, high[1],0)
buy_alert_low = ta.valuewhen(buy_condition, low[1],0)
short_alert_low = ta.valuewhen(short_condition, low[1],0)
short_alert_high = ta.valuewhen(short_condition, high[1],0)
buy_alert_high1 = ta.valuewhen(buy_condition, high,0)
plot(buy_alert_high, style = plot.style_circles)
plot(buy_alert_low, style = plot.style_circles, offset = -2)
plot(short_alert_low, style = plot.style_circles)
plot(short_alert_high, style = plot.style_circles)
sell = ta.crossunder(close, low) or SqTime //// or SqTime if for intraday exit
cover = ta.crossover(close,high) or SqTime //// or SqTime if for intraday exit
plotshape(buy_condition, style = shape.triangleup, location = location.belowbar, color = color.green, text = "BUY")
plotshape(short_condition, style = shape.triangledown, location = location.abovebar, color = color.red, text = "SHORT")
long_price = ta.valuewhen(buy_condition, (buy_alert_high + 0.01),0 )
longstop = buy_alert_low - 0.01
longtgt = basis
short_price = ta.valuewhen(short_condition,short_alert_low - 0.01,0) ////short_alert_low - (0.01 * 100 * syminfo.mintick) //// ta.valuewhen(short_condition,short_alert_low - 0.01,0)
shortstop = short_alert_high + 0.01
shorttgt = basis
strategy.entry("long",direction = strategy.long, when = buy_condition, limit = long_price, comment ="BUY")
strategy.close("long", when = sell, comment = "SELL")
strategy.exit("long", from_entry = "long", stop = longstop, limit = longtgt, comment = "TG/SL_EXIT")
strategy.entry("short",direction = strategy.short, when = short_condition,limit = short_price, comment ="SHORT")
strategy.close("short", when = cover, comment = "COVER")
strategy.exit("short", from_entry = "short", stop = shortstop, limit = shorttgt, comment = "TG/SL_EXIT")
plot(strategy.position_size > 0 ? longstop : na, style = plot.style_linebr, color = color.red)
plot(strategy.position_size > 0 ? longtgt : na, style = plot.style_linebr, color = color.green)
plot(strategy.position_size < 0 ? shortstop : na, style = plot.style_linebr, color = color.red)
plot(strategy.position_size < 0 ? shorttgt : na, style = plot.style_linebr, color = color.green)

Plotting a series of numbers into horizontal lines

I've been trying to figure out the code to plot lines like these based on me copy and pasting a series of numbers into the code each day. I was trying to use an array but I'm not sure that's what I need to do. Any help would be greatly appreciated!
Example
//#version=5
indicator("Input Levels", overlay = true)
lev1 = input.float(3990, title = "Val 1", inline = "1")
col1 = input.color(color.black, title = "", inline = "1")
lev2 = input.float(3890, title = "Val 2", inline = "2")
col2 = input.color(color.green, title = "", inline = "2")
lev3 = input.float(3995, title = "Val 3", inline = "3")
col3 = input.color(color.black, title = "", inline = "3")
lev4 = input.float(3870, title = "Val 4", inline = "4")
col4 = input.color(color.red, title = "", inline = "4")
lev5 = input.float(3826, title = "Val 5", inline = "5")
col5 = input.color(color.black, title = "", inline = "5")
var float[] level_vals = array.from(lev1, lev2, lev3, lev4, lev5)
var color[] color_vals = array.from(col1, col2, col3, col4, col5)
var line[] level_lines = array.new_line()
size = array.size(level_vals)
if barstate.isfirst
for i = 0 to size - 1
array.push(level_lines, line.new(x1 = na, y1 = na, x2 = na, y2 = na, style = line.style_dashed, color = color.black, extend = extend.both))
if barstate.islast
for i = 0 to size - 1
line_i = array.get(level_lines, i)
val_i = array.get(level_vals, i)
color_i = array.get(color_vals, i)
line.set_xy1(line_i, x = bar_index - 1, y = val_i)
line.set_xy2(line_i, x = bar_index, y = val_i)
line.set_color(line_i, color = color_i)
You can save the numbers in an array, then run a for loop in the array and plot dashed line at them. Example below
//#version=5
indicator(title="Plot numbers")
var numbers=array.from(3992.5,3990.25,3989,3987.25,3985,3983.25,3981,3977.25,3971.25,3966.5)
if barstate.isfirst
for i = 0 to array.size(numbers) - 1
line.new(bar_index, array.get(numbers,i),bar_index, array.get(numbers,i), style = line.style_dashed, color = color.black, extend = extend.both)

if statement with more conditions

I'm creating a automatic report generator, it's getting all its information out of a database.
You can see the progress in the pdf, in that progress you have an specific status, which is always 0, 1, 2 or 3.
If the status is 0-1 it should change an image to an incomplete image.
If the status is 2 it should change the image to an complete image
and if the status is 3 it should change the image to an not attempted imaged.
I've a code that support the first 2 which is:
IF( $F{status} == 2) ? $P{IMG_DIR} + "scorm_completed.png" : $P{IMG_DIR} + "scorm_incomplete.png"
Is there anybody who knows what I have to change?
Here is an example of how you would go about doing this:
<image>
<reportElement x="0" y="1" width="100" height="37"/>
<imageExpression>
<![CDATA[($F{status} == 3) ?
$P{IMG_DIR} + "not_attempted.png" :
(($F{status} == 2) ?
$P{IMG_DIR} + "scorm_completed.png" :
(($F{status} == 1 || $F{status} == 0) ?
$P{IMG_DIR} + "scorm_incompleted.png" : null))]]>
</imageExpression>
</image>
I am using a null placeholder for the case where the status is neither 0, 1, 2, or 3, but you might want to replace this with an error image.

Typo3: Can't remove link from YAML-Header in

Like the title says I have a website made with Typo3. I have a link in the yaml-header an can't remove it, because I don't find where it is added.
I know that in Template View on the Root Page in the Constant Editor the sites displayed there can be edited:
And I also know that it's possible to add some links with Typo-Script, looks similar to that I think:
lib.header.20.30 = TEXT
lib.header.20.30.value = Link1 Name
lib.header.20.30.typolink.parameter = http://link1.ziel
The Problem is, that I don't find the link I want to remove not in the headernavigationincludelist neither in the Typo-Script.
Constants:
### Change message, if user did not fill out mandatory fields:
styles.content.mailform.badMess = Leere Pflichtfelder:
[globalVar = GP:L = 1]
styles.content.mailform.badMess = You must fill in these fields:
[global]
[globalVar = GP:L = 2]
styles.content.mailform.badMess = Change Me:
[global]
### Change settings of Dropdown Sitemap extension:
plugin {
tx_dropdownsitemap_pi1 {
picture {
params = hspace="5" vspace="0" border="0"
}
}
}
### Begin of standard constants
### Only Yes/No options are listed here, for others see constant editor.
## searchbox
searchBoxOff = 0
## header
topNavOff = 0
firstHeaderImageOff = 0
secondHeaderImageOff = 0
linkFirstImageToggle = 1
noGifBuilderForFirstHeaderImage = 1
noGifBuilderForSecondHeaderImage = 1
## teaser
teaserOff = 1
rootlineOff = 0
languageMenuOff = 0
fontSizeSelectorOff = 0
dateAndTimeOff = 0
## basics
selectorBoxOff = 0
tabNavigationOff = 0
subMenuOff = 0
menuHeadlineOff = 1
subMenuExpandToggle = 0
footerOff = 0
## languages
languageLocaleStandardLang = german
languageLocaleFirstLang = english
languageLocaleSecondLang = french
languageIsoCodeStandardLang = de
languageIsoCodeFirstLang = en
languageIsoCodeSecondLang = fr
## headlines
replaceH1withImage = 0
replaceH2withImage = 0
replaceH3withImage = 0
replaceH4withImage = 0
replaceH5withImage = 0
## statistics
statisticsSetting = 0
statApacheSetting = 0
statMysqlSetting = 0
## expert settings
userAdmPanelOn = 1
userIndexingOn = 1
userIndexExternalsOn = 0
userDisablePrefComm = 0
yamlDebugOn = 0
yamlFillerLinkOn = 0
footerFirstLangHtmlCode = <div class="left">Born Informatik AG, Berner Technopark, Morgenstrasse 129, CH-3018 Bern</div><div class="right">Copyright © 2008 Born Informatik AG</div>
footerStandardLangHtmlCode = <div class="left">Born Informatik AG, Berner Technopark, Morgenstrasse 129, CH-3018 Bern</div><div class="right">Copyright © 2008 Born Informatik AG</div>
footerSecondLangHtmlCode = <div class="left">Born Informatik AG, Berner Technopark, Morgenstrasse 129, CH-3018 Bern</div><div class="right">Copyright © 2008 Born Informatik AG</div>
searchPagePID = 32
plugin.tt_news.archiveTypoLink.parameter = 32
styles.content.imgtext.maxW = 410
plugin.wtsnowstorm.pid = 1,1
plugin.tx_srlanguagemenu_pi1.showCurrent = 0
plugin.meta = name=google-site-verification
headerNavigationIncludeList = 128, 31, 33, 34
TSConstantEditor.yaml-header.5 = topNavOff, headerNavigationIncludeList
Setup:
###############################
# Delete default styles of
# Plugin dropdown sitemap
###############################
plugin.tx_dropdownsitemap_pi1._CSS_DEFAULT_STYLE >
###############################
# Delete default styles of
# cssstyledcontent (Copied to content.css, in order to be able to modify them there.)
###############################
plugin.tx_cssstyledcontent._CSS_DEFAULT_STYLE >
###############################
# Configuration of Statistics
###############################
page.headerData.100 < plugin.tx_kestats_pi1
###############################
# metatags-config
# Insert your own data here.
###############################
plugin.meta {
flags.useSecondaryDescKey = 0
flags.alwaysGlobalDescription = 1
flags.alwaysGlobalKeywords = 1
global.author = Born Informatik AG
global.email =
global.copyright = Born Informatik AG
global.keywords = Born Informatik AG
global.description = Born Informatik AG
global.revisit = 2 days
global.robots = index,follow
global.language = {$languageIsoCodeStandardLang}
}
#### Change language, keywords and description for first foreign language
[globalVar = GP:L = {$firstForeignLanguage}]
plugin.meta.global.language = {$languageIsoCodeFirstLang}
plugin.meta.global.keywords = my keywords for first foreign language
plugin.meta.global.description = my description for first foreign language
[global]
#### Change language, keywords and description for second foreign language
[globalVar = GP:L = {$secondForeignLanguage}]
plugin.meta.global.language = {$languageIsoCodeSecondLang}
plugin.meta.global.keywords = my keywords for second foreign language
plugin.meta.global.description = my description for second foreign language
[global]
page.headerData.999 < plugin.meta
###############################
# Configuration of newloginbox
###############################
plugin.tx_newloginbox_pi1._CSS_DEFAULT_STYLE >
plugin.tx_newloginbox_pi3._CSS_DEFAULT_STYLE >
###############################
# Configuration of tt_news
###############################
plugin.tt_news {
_CSS_DEFAULT_STYLE >
usePagesRelations = 1
usePiBasePagebrowser = 1
archiveTitleCObject {
10.strftime = %B - %Y
}
getRelatedCObject {
10.1.20.strftime = %d.%m.%y %H:%M
10.2.20.strftime = %d.%m.%y %H:%M
10.default.20.strftime = %d.%m.%y %H:%M
}
displaySingle {
date_stdWrap.strftime= %d.%m.%Y
time_stdWrap.strftime= %H:%M
age_stdWrap.age = Minuten | Stunden | Tage | Jahre
}
displayLatest {
date_stdWrap.strftime= %d.%m.%y
time_stdWrap.strftime= %H:%M
}
displayList {
date_stdWrap.strftime= %A %d. %B %Y
time_stdWrap.strftime= %d.%m.%y %H:%M
}
}
plugin.tt_news {
catOrderBy = title
displayCatMenu {
catmenuRootIconFile = EXT:tt_news/res/tt_news_cat.gif
catmenuNoRootIcon = 0
catmenuIconMode = -1
}
}
plugin.tt_news {
pageBrowser {
dontLinkActivePage = 1
maxPages = 10
showRange = 0
showPBrowserText = 1
showResultCount = 0
showFirstLast = 0
}
}
plugin.tt_news.displayLatest.subheader_stdWrap.crop = 100 | ... | 1
#### Change news-settings for first foreign language
[globalVar = GP:L = {$firstForeignLanguage}]
plugin.tt_news.getRelatedCObject.10.1.20.strftime = %d.%m.%y %H:%M
plugin.tt_news.getRelatedCObject.10.2.20.strftime = %d.%m.%y %H:%M
plugin.tt_news.getRelatedCObject.10.default.20.strftime = %d.%m.%y %H:%M
plugin.tt_news.displaySingle.date_stdWrap.strftime= %d.%m.%Y
plugin.tt_news.displaySingle.time_stdWrap.strftime= %H:%M
plugin.tt_news.displaySingle.age_stdWrap.age = Minutes | Hours | Days | Years
plugin.tt_news.displayLatest.date_stdWrap.strftime= %m/%d/%y
plugin.tt_news.displayLatest.time_stdWrap.strftime= %H:%M
plugin.tt_news.displayList.date_stdWrap.strftime= %A %d. %B %Y
plugin.tt_news.displayList.time_stdWrap.strftime= %d.%m.%y %H:%M
[global]
#### Change news-settings for second foreign language
[globalVar = GP:L = {$secondForeignLanguage}]
plugin.tt_news.displaySingle.age_stdWrap.age = Minutes | Heures | Jours | Ans
[global]
################################
# Configuration of indexedsearch
################################
plugin.tx_indexedsearch {
_CSS_DEFAULT_STYLE >
_DEFAULT_PI_VARS.results = 10
forwardSearchWordsInResultLink = 1
blind {
type=-1
defOp=0
sections=0
media=1
order=-1
group=-1
extResume=-1
lang=-1
desc=-1
results=0
}
show {
rules=0
parsetimes=1
L2sections=1
L1sections=1
LxALLtypes=0
clearSearchBox = 0
clearSearchBox.enableSubSearchCheckBox=0
}
search {
rootPidList =
}
}
## CSS for rgtabs was moved and edited in content.css
plugin.tx_rgtabs_pi1.pathToCSS >
lib.nav.20.1.wrap = <ul><li class="home"><span>Home</span></li>|</ul>
lib.nav.20.1.ACT.allWrap = <li class="active">|</li>
lib.nav.20.wrap = <div id="navmain">|</div>
lib.nav.20.excludeUidList = 2
lib.submenu.10.30.1.ACTIFSUB = 1
lib.submenu.10.30.1.ACTIFSUB.allWrap = <strong>|</strong><span class="hidden">.</span>
lib.submenu.10.30.1.ACTIFSUB >
lib.submenu.10.20.wrap = <li id="title">|</li><li id="separator">|</li>
plugin.tt_news.displayList.date_stdWrap.strftime = %d.%m.%Y
page.headerData.19 = TEXT
page.headerData.19.value = <link rel="SHORTCUT ICON" href="http://born.ch/fileadmin/img/icons/favicon.ico">
page.headerData.19.value = <link rel="SHORTCUT ICON" href="fileadmin/img/icons/favicon.ico">
#awstats congig
config.stat = 1
config.stat_apache = 1
config.stat_apache_logfile = intranet.log
# SNOWFLAKES!!
snowstorm = PAGE
snowstorm {
typeNum = 3136
10 < plugin.tx_wtsnowstorm
config {
disableAllHeaderCode = 1
disablePrefixComment = 1
xhtml_cleaning = 0
admPanel = 0
}
}
# Add javascript file to html header
page.headerData.3136 = TEXT
page.headerData.3136 {
wrap = <script src="|" type="text/javascript"></script>
typolink.parameter.data = page : uid
typolink.additionalParams = &type=3136
typolink.addQueryString = 1
typolink.returnLast = url
}
page.10 >
page.headerData.28.value = <script type="text/javascript" src="fileadmin/scripts/jquery-1.3.2.min.js"></script>
lib.footer.100.value = <div class="left">Born Informatik AG, Berner Technopark, Morgenstrasse 129, CH-3018 Bern</div><div class="right">Copyright © 2008-2011 Born Informatik AG</div>
config.sys_language_overlay = 1
lib.header.20.30 < lib.teaser.20.10
lib.header.20.30.languagesUidsList = 0,2
lib.header.20.30.defaultLayout = 2
lib.header.20.30.flag.CUR.doNotLinkIt = 1
lib.header.20.30.link.CUR.doNotLinkIt = 1
lib.header.20.30.links.CUR.doNotLinkIt = 1
lib.header.20.30.link.NO.stdWrap.wrap = | <div class="NO"> | </div>
page.headerData.2 = TEXT
page.headerData.2.insertData=1
page.headerData.2.case=lower
page.headerData.2.wrap = <meta name="google-site-verification" content="zc2lFQCXoXPUZrGCU-axHs4hoYSvruh2UsU9WgM_6VE">
page.headerData.3 = TEXT
page.headerData.3.insertData=1
page.headerData.3.case=lower
page.headerData.3.wrap = <meta name="google-site-verification" content="KCjWqRAjA0I77QRa9C909EPmEuX-UXb3vO213VBZeEg">
The link I want to remove ist the first one, the Intranet link:
Thanks in advance, if you need more infos to Help me just say what you need.
You surely have cleared the cache, I guess?
I'm wondering why in your listed TS constants there are five page-ids:
headerNavigationIncludeList = 30, 128, 31, 33, 34
The 30 is the ID of page "Intranet", I guess. It seems, your editing of the constants via the "Constant Editor" was not successful.

asp.net Column Chart is not aligning with the custom label and it does not display spaces between columns

I am trying to generate a chart to look this one
I am almost there but there are couple of issue that i can't solve.
The columns are being displayed with out a space separation between them! also the custom label that is at the very bottom is not aligning up with each column!
this is the output the i get out of my existing code
so
1) I need to spread the columns across the x axis
2) align the custom label to each column!
I appreciate any help or feedback on this problem
this is the code that generates the current image. Please keep in mind the my dataset "ds" have values like this
Emerging 28.45646456
Dent 14.1456465
Audio 27.456456
Cosmetic 43.44564456
Vet 35.15465646645
public void GenerateChart(){
//ds is generated and has values
Chart2.Series.Clear();
Chart2.Legends.Clear();
Chart2.Titles.Clear();
//if (ConfigurationManager.AppSettings["RunOnLocalhost"] == "True") {
if(HttpContext.Current.Request.Url.Host.ToLower() == "localhost"){
Chart2.ImageStorageMode = ImageStorageMode.UseImageLocation;
}
Chart2.Width = 1000;
Chart2.Height = 700;
Chart2.BorderlineDashStyle = ChartDashStyle.Solid;
Chart2.Titles.Add("Usage Impact By Industry");
Chart2.ChartAreas[0].AxisX.MajorGrid.LineColor = Color.LightGray;
Chart2.ChartAreas[0].AxisY.MajorGrid.LineColor = Color.LightGray;
Chart2.ChartAreas[0].AxisX.Interval = 1;
Chart2.ChartAreas[0].AxisY.Interval = 5;
Chart2.ChartAreas[0].AxisX.LabelStyle.Angle = -45;
Chart2.ChartAreas[0].AxisY.Title = "(%) Usage Lift";
Chart2.ChartAreas[0].AxisX.TitleFont = new Font("Arial", 16, FontStyle.Bold);
Chart2.ChartAreas[0].AxisY.Minimum = -5;
string tmp = "";
string sName = "";
double percentage = 0;
int i = 1;
int x = 1;
double index = 0.1;
foreach (DataRow Row in ds.Tables[0].Rows) {
if (tmp != Row["Industry"].ToString()) {
sName = Row["Industry"].ToString();
Chart2.Series.Add(sName);
Chart2.Legends.Add(sName).DockedToChartArea = "ChartArea1";
i++;
}
if (Convert.ToDouble(Row["B4"]) > 0) {
percentage = (Convert.ToDouble(Row["After4"]) - Convert.ToDouble(Row["B4"])) / Convert.ToDouble(Row["B4"]) * 100;
percentage = Math.Round(percentage, 0);
}
else {
percentage = 0;
}
Chart2.Series[sName].Points.AddXY(Row["Industry"].ToString(), percentage);
Chart2.Series[sName].ChartType = SeriesChartType.Column;
Chart2.Series[sName]["PointWidth"] = ".5";
Chart2.Series[sName].IsValueShownAsLabel = true;
Chart2.Series[sName].LabelFormat = percentage + "%";
CustomLabel label = new CustomLabel();
label.FromPosition = 0 + index;
label.ToPosition = .01 + index;
label.Text = Row["Industry"].ToString();
label.RowIndex = 0;
Chart2.ChartAreas[0].AxisX.CustomLabels.Add(label);
x++;
index += 0.2;
tmp = Row["Industry"].ToString();
}
}
I think you took the different series for the X-Axis. Take a single series in your chart like,
<asp:Chart ID="Chart1" runat="server">
<Series>
<asp:Series Name="Series1" XValueType="Auto" YValueType="Int32">
</asp:Series>
</Series>
<ChartAreas>
<asp:ChartArea Name="ChartArea1">
</asp:ChartArea>
</ChartAreas>
</asp:Chart>
Here I have taken "Series1" in chart.
Now replace your "sName" with "Series1"
Chart2.Series[sName].Points.AddXY(Row["Industry"].ToString(), percentage);
to
Chart2.Series["Series1"].Points.AddXY(Row["Industry"].ToString(), percentage);
I think problem should be solved.